Purchase Order Receipt not properly saving

I'm working on an integration for a client and am trying to create PO Receipts using c# and Sage 100's BOI. The end result shows the vendor when I look at all PO Receipts, but the receipt is empty when I view the full receipt

Here are the current steps I am taking.

Get next key with the method "GetNextReceiptNo"

Set Key with "SetKey"

Set Purchase Order Number with "SetValue"

Iterate through the PO Lines and first add a new line via "AddLine"

I then go through and set the properties for each line. These properties are currently being set in the order of ItemCode, OriginalQtyOrdered, QuantityReceived, and UnitOfMeasure

After the properties are each set via "SetValue, I invoke a "Write" for the line.

After all lines are wrriten I invoke one final "Write" method.

Along each step, I am verifying that each method is returning a true result and have error handling if this is not the case.

I have tried other methods from the PO_Receipt_Bus object including "CopyFromPurchaseOrder", "nCopyFromPurchaseOrder", "ApplyPurchaseOrderUpdate", and "ApplyPurchaseOrderCopyLines". The result is always the same though.

What else am I missing?

  • Did you set the receipt type?    You need to set receipt type, for a receipt of goods or a receipt of invoice, as well as receipt number and then do a set key.  

  • in reply to daburke

    I thought that using the PO_Receipt_Bus object would clarify that we are creating a Receipt of Goods. What is the correct way to set the receipt type? I tried something like this but I get an error stating "The column is not in the IOList."

    busObj.InvokeMethod("nSetValue", new[]
    {
    "ReceiptType", "G"
    });

    From what I can tell there is no method for setting the Receipt Type specifically.

  • in reply to Clint Thompson

    PO_Receipt_Bus is used for both Receipt of Goods and Receipt of Invoice.

    ReceiptType is part of the key so you'll need a

    busObj.SetKeyValue("ReceiptType$", "G"),

    along with setting the ReceiptNo, followed by a "SetKey."