Sage MAS 90 and 200 Sage MAS 500 blogs Product Feedback Support Training
Reply
Regular Contributor
brc
Posts: 106
Registered: 11-04-2008
0
Accepted Solution

Can't pull Vendor Div from Manual Check Invoice Detail

[ Edited ]

4.40 su6.

While doing a GL distribution in AP Manual Check Invoice Detail, I'd like to validate a segment of the GL account based on the Vendor Division No.  I can't seem to access the Vendor Div No using either the

oHeader.obj.Getvalue("APDivisionNo$" , ntmp_APDiVisionNo)

nor the

SET oVend = oBusObj.AsObject( oBusObj.GetChildHandle(“VendorNo”))

 

any ideas?

Brian
Sage Employee
jepritch
Posts: 233
Registered: 08-25-2009
0

Re: Can't pull Vendor Div from Manual Check Invoice Detail

Hi Brian,

 

I posted a similar solution to this for Tier distribution: http://community.sagemas.com/t5/Business-Object-Interface/Pass-UDF-value-from-IM-Transaction-to-the-...

 

I think this maybe a good application for using storage variables.  I assume you wish to use the vendor for which the cheque is for?  So, what I would do is to create 2 scripts.  The Manual Cheque header is two levels above the  business object you are working in.  So, we need to use a common memory space.

 

So script 1, should be attached to Post-Read and Post-Validate (APDivisionNo) events on the AP_ManualCheckHeader table and script 2 should be attached to Pre-Validate event (if you want to PRE-vent) for AccountKey

 

Script 1

 

retval = 0

div     = ""

oScr  = 0

 

Set oScr = oSession.AsObject(oSession.ScriptObject)

 

retVal = oBusObj.GetValue("APDivisionNo", div)

retVal = oScr.SetStorageVar("CurDiv", div) ' store off value

 

Script 2

 

retVal = 0

div      = ""

oScr  = 0

Set oScr = oSession.AsObject(oSession.ScriptObject)

 

retVal = oScr.GetStorageVar("CurDiv", div) ' retrieve stored division

 

' {then do whatever your validation is going to be }

 

Hope this helps

Elliott

Regular Contributor
brc
Posts: 106
Registered: 11-04-2008
0

Re: Can't pull Vendor Div from Manual Check Invoice Detail

That worked like a charm.  Many thanks Elliott.

Brian