- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
PO Line Discount Script
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
02-16-2011 09:04 AM
Please be kind, this is my first try at scripting. Mas90 v4.4 Service Pack 4
If a vendor has a discount which I add as a UDF in the Purchase Order Header, I want to calculate the cost of the item
based on the cost manually entered minus the discount. I cannot use the Price Level maintenance, because they will manually enter the cost. I have a PO Header UDF for discount, PO Line UDF for Y/N if I applied the Discount. Doing this at Pre-write of the record.
Getting Error 88 Invalid/Unknown Property name in SY_MAINT.PVC
TmpDisc=0
TmpApply="N"
TmpCost=0
retVal=oBusObj.GetValue("UDF_DISCAPPLIED$",TmpAppl
retVal=oBusObj.GetValue("UDF_DISCOUNT",TmpDisc)
retVal=oBusObj.GetValue("UnitCost",TmpCost)
if TmpApply <> "Y" then
retVal = oBusObj.GetValue("UnitCost", TmpCost)
retVal = oBusObj.SetValue("UDF_DISCAPPLIED$", "Y")
retVal = oBusObj.SetValue("UnitCost",TmpCost*TmpDisc)
End if
retVal = oBusObj
Solved! Go to Solution.
Re: PO Line Discount Script
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
02-16-2011 10:39 AM
It appears you have this line in there twice:
retVal=oBusObj.GetValue("UnitCost",TmpCost)
Also I think you can take out this line:
retVal = oBusObj
Dawn
Re: PO Line Discount Script
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
02-16-2011 11:21 AM - last edited on 02-16-2011 11:59 AM
Thanks Dawn!
No more error, but I still have 1 problem.
How can I get the new values to display after I change it?
Thank you in advance.
Re: PO Line Discount Script
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
02-18-2011 02:54 PM
Since this is my first script, I have a change in plans.
I will not show 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.
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
retVal=oBusObj.SetValue("UDF_DISCAMT",(TmpCost*Tmp
Thank you in advance.


