- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Script to retrieve data in SO Lines
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-26-2012 06:19 PM
Hoping someone can help with some code on a script. I am using MAS90 4.40. I created a UDF in SO Lines and I am trying to copy the Desc of the GL Sales Account in SO Lines into the UDF. I need to do this while the user is on each line because additional processing takes place on the UDF and needs to be displayed on the line. I can get to data in that object using GetVal() and SetVal but I guess my question is how do I get to data that is not in that object.
Thanks
Re: Script to retrieve data in SO Lines
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-26-2012 10:36 PM
Re: Script to retrieve data in SO Lines
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-26-2012 10:38 PM
Try this:
SET oGLAcct = oBusObj.AsObject(oBusObj.GetChildHandle("SalesAcct Key"))
sAccountDesc = ""
retVal = oGLAcct.GetValue("AccountDesc$", sAccountDesc)
Re: Script to retrieve data in SO Lines
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-26-2012 10:50 PM
Dan, thank you. I will try it and let you know. If you could help me out with one more I'd appreciate it. In the same scenario I also need to retrieve the taxclassdesc entered on the SO Line. Sorry, I'm kinda new to this and not sure where to get all the Objects/Methods etc.
Re: Script to retrieve data in SO Lines
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-26-2012 11:14 PM
You should have been able to follow the pattern...
SET oTaxClass = oBusObj.AsObject(oBusObj.GetChildHandle("TaxClass" ))
sTaxClassDesc = "Nothing Returned"
retVal = oTaxClass.GetValue("TaxClassDesc$", sTaxClassDesc)
Re: Script to retrieve data in SO Lines
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-27-2012 07:22 AM
Dan, It did work but not doing exactly what I need. I think I will email you directly. Thanks for all your help
Re: Script to retrieve data in SO Lines
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-27-2012 07:52 AM
Hi Kenny,
Depending on what you are intending to do with these descriptions, you may not need any scripting at all. If all you want to do is have the Sales Account Description display in Sales Order Entry, you don't even need to add a UDF.
1. Custom Office/Customizer Selection
2. Choose Sales Order/Sales Order Entry
3. Select DLINES
4. Dbl-Click the secondary grid (or primary one if that's where you want the description)
5. Click the Add fields button on the right side
6. When the field selection window appears, click the Show All button (this will show Sage's fields and not just UDF's)
7. Scroll down and expand the SALESACCTKEY folder
8. Choose AccountDesc
This adds the description as a display-only field into your secondary grid.
If you want the user to modify the description VIA a UDF then you can also do this without Scripting. When you define your UDF, instead of making it Manual Entry, source it from the SO_SalesOrderDetail_bus Business Object. Select the Data Source of SalesAcctKey and select the AccountDesc for the Column. Then you can add this to your grid in Customizer Selection like above, just select your UDF instead. Now, it will default to the normal description and you can edit it to display on the journal or wherever.
Just food for thought. Scripting is very powerful, but so is the regular inherent abilities of customizer. ![]()
Elliott
Re: Script to retrieve data in SO Lines
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-27-2012 08:02 AM
Small correction: PLINES instead of DLINES
Re: Script to retrieve data in SO Lines
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-27-2012 08:04 AM
Thanks Gator ![]()
Re: Script to retrieve data in SO Lines
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-27-2012 08:48 AM
Thanks Elliot, I already tried the UDF route, it will not actually bring it over for editing while the user is enetering the order lines. It only saves it after the order is saved. I looked in DFDM and its there but I cannot see the desc in the UDF during data entry.


