Sage MAS 90 and 200 Sage MAS 500 blogs Product Feedback Support Training
Reply
Sage Employee
jepritch
Posts: 236
Registered: 08-25-2009
0

Re: Script to retrieve data in SO Lines

Hmmmm, this seems to work for me.

 

I created a UDF in the SO_SalesOrderDetail table called SalesAcctDesc (UDF_SalesAcctDesc$), and sourced it from the SO_SalesOrderDetail_bus : SalesAcctKey : AccountDesc.   I added this UDF_SalesAcctDesc$ to my secondary grid in Sales Order Entry.

 

Now, when I go into Sales Order Entry, I enter the header information and proceed to the lines panel, and select an item code.  This automatically defaults a sales account for me, and my UDF has the description defaulted, and the field is editable.

 

During Data entry, you are correct this value will not be saved back to the lines of the sales order until you accept the entire sales order.  This is true of anything you change on the sales order during data entry.

 

What are you trying to accomplish?  Are you wanting to update the actual GL Account Description with this value?

 

Elliott

 

 

 

Sage MAS Partner
kenny
Posts: 14
Registered: 10-04-2010
0

Re: Script to retrieve data in SO Lines

Elliot, you are probably right but I think the problem comes when the sales account is changed on the SO Line. I dont think the UDF will get updated with the new DESC of the selected account. What I am trying to do is to bring over the GL Desc and TaxClassDesc over to the SO lines. We store some special data in these description fields. I want to extract certain pieces from those Desc fields and save the results in another UDF. The user will be changing the GL Account and Tax Class on each line.

Thanks for your help.
Sage Employee
jepritch
Posts: 236
Registered: 08-25-2009
0

Re: Script to retrieve data in SO Lines

Ahhh, okay.  I do think the UDF mapped to the description will change when the account is changed on the line, however to manipulate the portions of the description you are correct you would need to do that through some post-validation script on the sales account/tax class. 

Sage MAS Partner
kenny
Posts: 14
Registered: 10-04-2010
0

Re: Script to retrieve data in SO Lines

Elliot, I can handle the data manipulation via a script if the UDF would update with the new desc everytime a user changes the account or the tax class, but I can't get it to do that. Any ideas?
Sage MAS Partner
kenny
Posts: 14
Registered: 10-04-2010
0

Re: Script to retrieve data in SO Lines

Elliot, here is the latest. The reason I said the UDF was not working is that I was trying to bring over the TAXCLASSDESC while you were working with the GLDESC. For some strange reason, the GLDESC passes thru to the UDF just fine but the TAXCLASSDESC will not. It will remain empty and only get updated when i manually change the TAX CLASS in SO Lines.

Last weird point, If you select a MISC Item rather than an Inventory Item it all works great the first time.

 

Thanks for your help. Let meknow if you have any ideas. 

Sage Employee
jepritch
Posts: 236
Registered: 08-25-2009
0

Re: Script to retrieve data in SO Lines

Hi Kenny,

 

I see what you mean about the TaxClassDesc.  I'm not sure why it isn't set initially for the regular items, but I will look into that.  In the meantime, you probably need to put a script on the Post-Validate of the Itemcode, to read the description and set the value into your UDF.

 

retVal = 0

oTaxClass = 0

Set oTaxClass = oSession.AsObject(oBusObj.GetChildHandle("TaxClass"))

 

tc = ""

retVal = oBusObj.GetValue("TaxClass$", tc)

If tc<>"" Then

  retVal = oTaxClass.Find(tc)

  If retVal<>0 Then

     desc = ""

     retVal = oTaxClass.GetValue("TaxClassDesc$", desc)

     retVal = oBusObj.SetValue("UDF_Whatever$", desc)

  End If

End If

 

 

Thanks

Elliott

 

Sage MAS Partner
kenny
Posts: 14
Registered: 10-04-2010
0

Re: Script to retrieve data in SO Lines

Hi Elliot. Thanks for all your help with this. Sounds like this will work. Will try it and let you know. On another note, where is the best place to get more info on the Objects, Classes, Methods, etc  within MAS90?

Sage Employee
jepritch
Posts: 236
Registered: 08-25-2009
0

Re: Script to retrieve data in SO Lines

kenny,

 

The best resource is in our help documentation, under file layouts and program information.  Via the MAS 90 Desktop, go to Top Level (Sage ERP MAS 90)/ Resources/File Layouts and Program Information.  There is a section in there for Object Reference.  This gives you an idea of the functions and properties available. 

 

Thanks

Elliott