Sage MAS 90 and 200 Sage MAS 500 blogs Product Feedback Support Training
Reply
Sage MAS Partner
VKZIMM
Posts: 767
Registered: 11-10-2008
0
Accepted Solution

Receipt of Goods Total after Script

I am not showing the Unit Cost field, but created a Unit Cost UDF field for Entry which would be the full amount and I will calculate the unit cost from that amount.  That works well and during entry all is fine, but if I make a change to the UDF Unit Cost, the Extension is calculated correct, but on the bottom of the screen the Total is not updated.  If I go to the totals tab and back to the Lines tab, then the screen Total displays correctly or if I go back and re-enter the quantity field the total is correct.

I.

This is my script which is done Column Post Validate on my UDF Unit Cost field

TmpDisc=0
TmpCost=0
TmpAmt=0
TmpQty=0
retVal=oHeaderObj.GetValue("UDF_DISCPCT",TmpDisc)
retVal=oBusObj.GetValue("UDF_NEWCOST",TmpCost)
retVal=oBusObj.GetValue("UDF_DISCAMT",TmpAmt)
retVal=oBusObj.GetValue("QuantityOrdered",TmpQty)
retVal=oBusObj.SetValue("UnitCost",(TmpCost-(TmpCo​st*TmpDisc)))
retVal=oBusObj.SetValue("UDF_DISCAMT",(TmpCost*Tmp​Disc))

Thank you in advance.

Regular Contributor
Gator
Posts: 270
Registered: 12-05-2008
0

Re: Receipt of Goods Total after Script

I'm not sure if there is a good solution to this or not.  I'm also struggling with the same thing.  The problem is we are totally on the business object side with scripting.

 

In MAS when the UI Unit Cost field is changed, a UI event fires that makes a call to change the value in the business object, then it runs code to update the total field which exists in the UI.  The total field doesn't even exist in the business object as it is just a calculated field.

 

I'll let you know if I figure anything out.

Regular Contributor
Gator
Posts: 270
Registered: 12-05-2008

Re: Receipt of Goods Total after Script

If you do not mind using a different UDF field for the total, then it appears what Dawn describes in the below post will work.

 

http://community.sagemas.com/t5/Personalization-Customization/Total-field-displaying-total-Qty-order...