Create Sales Order Lines Object from MS Access Module

SUGGESTED

Good Day,

I hope this message finds you well. I am currently facing an issue with a control I've created in MS Access that interacts with Sage100 (Standard 2020 v6.20.4). I'm reaching out to seek your assistance in resolving this matter.

The control performs the following actions:

  1. Logs into Sage100.
  2. Locates and sets the Sales Order, updating the UDF_SMI_Release value on the sales order header.
  3. Iterates through the lines of the Sales Order and updates the UDF_PMQTY value.
  4. write the line record.
  5. write the header record

However, I've encountered a problem. Despite receiving successful return values for edtLne (2), getVal (1), and setVal (1), the write line returns an error stating, "File does not exist: File: RA_Options." When I suppress the write line the header write preforms as expected but the values in the lines section of the Sales Order do not update.

I want to highlight that the Sage version I'm currently testing on has Scanco's PM and Multi-bin installed. Although these enhancements have caused interference with the User Interface (UI) and Business Object Interface (BOI) in the past, I am unsure if they are the cause of this particular issue.

I've included snippets of the associated code and a screenshot of the relevant access screen below:

I would greatly appreciate your expertise and guidance in resolving this issue. If there is any additional information or details you require, please let me know.

Best Regards,

-SKG


Pasted code snippets: Access screenshot below:

setVal = oSOHdr.nSetKeyValue( "SalesOrderNo$", sSONo )
setKey = oSOHdr.nSetKey()
setVal = oSOHdr.nSetValue( "UDF_SMI_RELEASE$", bSMI )
MsgBox( IsObject( oSOHdr.oLines ) )
'
'movVal = oSOHdr.oLines.MoveFirst() '< Error line is commented
'Do While Not cBool( oSOHdr.oLines ) '< Error line is commented
'
edtLne = oSOHdr.oLines.nEditline( sLineKey ) return  value = 2
If edtLne = 0 Then : MsgBox("ERROR edit line method " & oSS.sLastErrorMsg) : Else MsgBox("Edit Line " & edtLne & ":"& sLineKey & " method Good") '< debug only
'
getVal = oSOHdr.oLines.nGetValue( "ItemCode$", sItemCode ) return value = 1
If getVal = 0 Then : MsgBox("ERROR Get value " & oSS.sLastErrorMsg) : Else MsgBox("Get Item " & getVal & ":" & sItemCode & " value Good") '< debug only
'
setVal = oSOHdr.oLines.nSetValue( "UDF_PMQTY", nPMQty ) return value = 1
If setVal = 0 Then : MsgBox("ERROR Set value " & oSS.sLastErrorMsg) : Else MsgBox("Set " & setVal & ":" & nPMQty & " Value method Good") '<debug only
'
wrtVal = oSOHdr.oLines.nWrite() '<Error #12
If wrtVal = 0 Then : MsgBox("Line Write ERROR > " & oSS.sLastErrorMsg) : Else MsgBox("Line wrtVal SO " & wrtVal & ":" & sSONo & sLineKey & " Good") '< debug only
'
'movVal = oSOHdr.oLines.MoveNext() '< Error
'
'Loop '<Error
'
wrtVal = oSOHdr.nWrite()
If wrtVal = 0 Then : MsgBox("ERROR wrtVal " & oSS.sLastErrorMsg) : Else MsgBox("wrtVal SONo " & sSONo & " Good") '< debug only
'
End If
rst.MoveNext

  • 0 in reply to Steve Passmore

    Steve,

    I hope this message finds you well. Since 1993, I have witnessed the remarkable growth of this product, and even now, I am driven to enhance its usefulness and contribute towards improving the overall user experience.

    I want to express my sincere appreciation for your decision to contribute your time and expertise in the likeness.

    Your commitment is truly valued and makes a significant impact.

    I am committed to continue this research journey to discover a solution that aligns with the customer's desired functionality for the UI.

    I will persevere in my efforts to find the appropriate resolution.

    Best Regards,

    SKG

  • 0 in reply to SKG HIBARS
    SUGGESTED

    In VBA BOI scripting, and BOI in general object properties begin with a letter that identifies type. "o" is for object and while ".lines"  works in event scripting or UDS's, ".oLines" is used in BOI. I also don't use the method AsObject to get a lines object I use:

    Set oSOLines = oSOHdr.oLines

    This is how I was taught in BOI class 25 years ago: Set oGLJournalLines = oGLJournalEntry.oLines

  • 0 in reply to connex

    I don't do external scripting, just UDS run from within Sage business objects.  That is the syntax I use... but of course, some syntax details for external scripts are different, as you know.