Sage 100

 View Only
Expand all | Collapse all

BOI - Create Invoice from Sales Order (How to update lines for Qty Shipped

  • 1.  BOI - Create Invoice from Sales Order (How to update lines for Qty Shipped

    Posted 06-13-2022 21:45
    I should know this, but perhaps I'm getting old and it's harder to remember. I search through examples and prior posts, but can't find something I believe I saw before.

    Working on a BOI script (external script) to create an invoice from a sales order. Having no issue with oSOInvoiceLines.nCopyLinesFromSalesOrder(SalesOrderNo, "YES"). The issue is if "NO" is set and then having to set the quantity shipped for each line.

    1. OrderLineKey from the sales order is known.

    2. Here is the creation of objects that matter here.
    Set oSOInvoice = oScript.NewObject("SO_Invoice_bus", oSS)
    Set oSOInvoiceLines = oSOInvoice.oLines

    Question - How is the oSOInvoiceLines object set to a specific line on the invoice, edit the line, and assign the quantity shipped? The last two commands would be:

    retVal = oSOInvoiceLines.nSetValue("QuantityShipped",dblQtyShipped)
    retVal = oSOInvoiceLines.nWrite()

    Thank you.


    ------------------------------
    Myron Stevenson
    Consultant
    Clearis Consulting, Inc
    Duluth, MN
    218-525-6720
    ------------------------------


  • 2.  RE: BOI - Create Invoice from Sales Order (How to update lines for Qty Shipped

    Posted 06-14-2022 17:26
    If you know the OrderLineKey, then you need to either loop through the lines and check the OrderLineKey against your value, if it matches, then set you value and write the line.  You could also use GetResultSets and have it return the full key so you can pass it to the lines' SetKey method and then set your value and write the line.  GetResultSets has an argument where you specify a record filter and you would do so against the OrderLineKey field.

    ------------------------------
    David Speck II
    Tennessee Software Solutions
    ------------------------------