Sage 100

 View Only
  • 1.  AR_CustomerDocuments_bus via BOI

    Posted 02-08-2023 12:40
    C# BOI app needing to write Customer Paperless info into Sage 100.

    The following line:
    DispatchObject sage = new DispatchObject(pvx.InvokeMethod("NewObject", "AR_CustomerDocuments_bus", oSS.GetObject()));
    returns the wonderfully vague error:  "Exception has been thrown by the target of an invocation."
    It seems to occur on the InvokeMethod routine in the DispatchObject class.

    Any ideas on what might be wrong or what special handling this object needs?

    #BOI #scripting​​

    ------------------------------
    Phil McIntosh
    President
    Friendly Systems, Inc.
    ------------------------------


  • 2.  RE: AR_CustomerDocuments_bus via BOI

    Posted 02-09-2023 11:20

    Does your code first setprogram to AR_Customer_UI? 



    ------------------------------
    Eric Lunceford
    First Mate Business Solutions
    Oklahoma City, OK
    877-880-8960
    ------------------------------



  • 3.  RE: AR_CustomerDocuments_bus via BOI

    Posted 02-09-2023 14:21

    I was wondering about that, and will give it a try.



    ------------------------------
    Phil McIntosh
    President
    Friendly Systems, Inc.
    ------------------------------



  • 4.  RE: AR_CustomerDocuments_bus via BOI

    Posted 02-10-2023 11:35

    Thanks @Eric Lunceford That worked for AR_CustomerDocuments_bus, but when I try it with AR_CustomerDocumentContacts_bus, I get messages that ARDivisionNo, CustomerNo and  Document are read only, and then of course SetKey says "missing or invalid header".

    Any ideas on this one?



    ------------------------------
    Phil McIntosh
    President
    Friendly Systems, Inc.
    ------------------------------



  • 5.  RE: AR_CustomerDocuments_bus via BOI

    Posted 02-10-2023 14:25

    The contacts object is a line object of the documents object.

    I can't help with C# syntax, but...

    Set oCustDocs = oScript.NewObject("AR_CustomerDocuments_Bus",oSS)
    Set oDocContacts = oCustDocs.oLines



    ------------------------------
    Eric Lunceford
    First Mate Business Solutions
    Oklahoma City, OK
    877-880-8960
    ------------------------------