How to get Child or sub file (table) level data from Sage VB Script

SUGGESTED

Hi All,

  I need to display a message box on Shipping Data Entry interface.  I can get data from "SO Sales Order Header"  and "SO Shipping Data Entry" and "Customer....".

On Custom Office using trigger of ""SO Shipping Data Entry"" and Pre-Write.

But, I could NOT get MEMO data from "SO Sales Order Memo" using the same logic code.  Please help!  Thank you all.

retVal = 0
oCust = 0
memo_code = ""

SET oCust = oBusObj.AsObject(oBusObj.GetChildHandle("SalesOrderNo"))

retVal = oCust.GetValue("MemoCode$", memo_code )
retVal = oScript.SetError("MEMOCODE string - is not blank! " & memo_code )

' set oCust = oSession.AsObject(oBusObj.GetChildHandle("SalesOrderNo"))  --- tested
' Set oCust = oSession.AsObject(oBusObj.GetChildHandle(“CustomerNo”)) --- sample

Parents Reply Children
  • 0 in reply to Kevin M

    "Shouldn't be" is the keyword but sometimes i find that you have to force the child object to be on the correct record and this is done either by setting each key value followed by Find or my using ReadAdditional without any arguments to force all child objects to read the "correct" record or pass the field used for the child object as the first argument to force just that child object to read the "correct" record. This should be done prior to using GetValue from the child object.

  • 0 in reply to David Speck

    Yes... "should" is not the way things always are indeed.  After your comments (here an in previous posts) I have made a mental note to try ReadAdditional the next time I have issues with a child handle.