- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Setting GL Account Code
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-13-2012 04:08 PM
Hello all.....
I'm on MAS90 4.4 SU5.
If I set the GL acount code for a MISC Item before i bring it into a PO it works fine. the issue I am having is trying to set the GL Acct code while creating the line in the P.O.
here's what i have:
retval = oPurchObj.oLines.nAddline()
retval = oPurchObj.oLines.nSetvalue("Itemcode$", "/101")
retval = oPurchObj.oLines.nSetvalue("QuantityOrdered", 3)
retval = oPurchObj.oLines.nSetvalue("Unitcost", 40.00)
retval = oPurchObj.oLines.nSetvalue("PurchAcctKey$", "475048045100")
'retval = oPurchObj.oLines.nSetvalue("PurchAcctKey$, "47504804J") - When I manually enter the Order in MAS PO_PurchOrderDetail is populated with this account number in PurchaseAcctKey Column.
retval = oPurchObj.oLines.nWrite()
I assume i need to "call" it a different way when writting the GL account code.
What further confuses me is why the GL Account code is written to MAS like that. when i view the PO in MAS the Gl Account code is written out in its entirety. when look at in the the talble it lops off the "5100" and puts a "J"
any help is appreciated!
Thanks
Matt
Re: Setting GL Account Code
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-13-2012 04:30 PM
NM... i was able to figure it out......
retval = oPurchObj.oLines.nSetvalue("AccountKey$", "4750-480-451-00")
Automatically populates the field with the proper key.
Thanks
Re: Setting GL Account Code
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-18-2012 11:22 AM
i spoke to soon. i still cannot get the script to write the G/L account when creating the PO Line. The error i get is:
"update is not successful: This Purchase Order has no lines and has zero total amounts."
Thanks
Re: Setting GL Account Code
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-18-2012 11:35 AM
Hi matthewb,
Where exactly are you using your script? Is this a button driven script from within Purchase Order Entry? Or in a totally different applicaiton. It looks from your script that you are not doing this from within the PO Entry object itself, but outside of it.
This error usually occurs if you forgot to do a Write() to the line itself, before updating the header.
Hope this helps.
E


