How to Add a Shipment using the Advantage dll or the Web Api?

SOLVED

I have been trying to add a shipment to a Sales Order but haven't been able to do so.

Did not see any option to such transaction on the Web Api so moved the Advantage dll.

Tried to write to the view OE0434 and it does create a shipment, however I haven't been able to write any details to record the Quantity Shipped.

I have been searching the web for an example on how to enter a shipment so it can be invoiced without any luck.

Does anyone has an example on how to enter a Shipping Transaction against a Sales Order?

Either using the Advantage Api or the Web Api.

If there is a way using the COMAPI, I am willing to try anything since currently I am stuck.

Thanks.

  • 0

    Use the Order object OE0520. 

    Read the header

    Browse the details

    Set OEORDD.QTYSHIPPED

    Post the order

  • 0 in reply to Jay Converse Acumen

    Thanks, will try just now. Hope that does it.

  • 0

    I haven't actually tried this and don't do much with OE anymore but I do see that there is a Post under the list of operations OEOrders in the Web API (V2021) and if you look at the OrderDetails you will see QuantityShipped so I am assuming it would create a shipment if populated.

    Here is a snippet of the JSON

    "OrderDetails": [
    {
    "OrderUniquifier": 0,
    "LineNumber": 0,
    "LineType": "Item",
    "Item": "string",
    "MiscellaneousChargesCode": "string",
    "Description": "string",
    "ItemAccountSet": "string",
    "UserSpecifiedCostingMethod": true,
    "PriceList": "string",
    "Category": "string",
    "Location": "string",
    "PickingSequence": "string",
    "ExpectedShipmentDate": "2020-10-27T20:09:29.988Z",
    "StockItem": true,
    "QuantityOrdered": 0,
    "QuantityShipped": 0,
    "QuantityBackordered": 0,
    "QuantityShippedtodate": 0,
    "OriginalQuantityOrdered": 0,
    "POQuantityOrdered": 0,
    "OrderUnitOfMeasure": "string",
    "OrderUnitConversion": 0,

  • 0 in reply to kkyle2

    Just tried the update via the Advantage and it does not adjust the shipped quantity.

    Updating the Sales Order sounds weird as a Shipment has other information related to it. Not only a quantity. There is a shipment document that is generated and and invoice related to that shipment. As an order can have multiple Shipments associated to it.

    From the Gui, a shipment is not entered from the OE screen but within a Shipment Entry screen.

    Thanks for the replies, but editing the OE is not working.

  • 0 in reply to Javier H

    I have tried everything I can think of just to crash and burn every time.

    Here is an example of my code. I am trying to post the shippment but it is not going in.

    It does create a header for the shipment and a detail with 0 as shipped quantity. What I am doing with the details has no effect on the transaction.

    var dbLink = CreateDbLink(session);
                View OEISHIH = dbLink.OpenView("OE0434");
                View OEISHID = dbLink.OpenView("OE0433");
                View OESHID = dbLink.OpenView("OE0691");
                View OESHIH = dbLink.OpenView("OE0692");
                View GENSTUB = dbLink.OpenView("OE0999");
                View OECOINS = dbLink.OpenView("OE0190");
                View OETERMS = dbLink.OpenView("OE0745");
                View OESHIR = dbLink.OpenView("OE0694");
                View OESHIHO = dbLink.OpenView("OE0704");
                View OESHTD = dbLink.OpenView("OE0697");
                View OESHTH = dbLink.OpenView("OE0698");
                View OESHTDD = dbLink.OpenView("OE0699");
                View OESHTDDS = dbLink.OpenView("OE0676");
                View OESHTDDL = dbLink.OpenView("OE0675");
                View OESHTDS = dbLink.OpenView("OE0671");
                View OESHTDL = dbLink.OpenView("OE0670");
                View OESHIDO = dbLink.OpenView("OE0702");
                View OESHIDB = dbLink.OpenView("OE0705");
                View OESHIDD = dbLink.OpenView("OE0703");
                View OESHIDDS = dbLink.OpenView("OE0706");
                View OESHIDDL = dbLink.OpenView("OE0707");
                View OESHIDS = dbLink.OpenView("OE0709");
                View OESHIDL = dbLink.OpenView("OE0708");
                View OEISHDO = dbLink.OpenView("OE0431");
                View OEISHIDS = dbLink.OpenView("OE0436");
                View OEISHIDL = dbLink.OpenView("OE0435");
                View OEICOIS = dbLink.OpenView("OE0273");
                View OEISHHO = dbLink.OpenView("OE0432");
                OEISHIH.Compose(new View[] { OEISHID, GENSTUB, OEICOIS, OEISHHO });
                OEISHID.Compose(new View[] { OEISHIH, OESHID, OEISHDO, OEISHIDS, OEISHIDL });
                OESHID.Compose(new View[] { OESHIH, OESHTD, OESHIDO, OESHIDB, OESHIDD, OESHIDS, OESHIDL });
                OESHIH.Compose(new View[] { OESHID, GENSTUB, OECOINS, OETERMS, OESHIR, OESHIHO });
                
                OECOINS.Compose(new View[] { OESHIH, OESHID });
                OETERMS.Compose(new View[] { OESHIH });
                OESHIR.Compose(new View[] { OESHIH });
                OESHIHO.Compose(new View[] { OESHIH });
                OESHTD.Compose(new View[] { OESHTH, OESHTDD, OESHTDS, OESHTDL });
                OESHTH.Compose(new View[] { OESHTD });
                OESHTDD.Compose(new View[] { OESHTD, OESHTDDS, OESHTDDL });
                OESHTDDS.Compose(new View[] { OESHTDD });
                OESHTDDL.Compose(new View[] { OESHTDD });
                OESHTDS.Compose(new View[] { OESHTD });
                OESHTDL.Compose(new View[] { OESHTD });
                OESHIDO.Compose(new View[] { OESHID });
                OESHIDB.Compose(new View[] { OESHID });
                OESHIDD.Compose(new View[] { OESHID, OESHIDDS, OESHTDD, OESHIDDL });
                OESHIDDS.Compose(new View[] { OESHIDD, OESHTDDS });
                OESHIDDL.Compose(new View[] { OESHIDD, OESHTDDL });
                OESHIDS.Compose(new View[] { OESHID, OESHTDS });
                OESHIDL.Compose(new View[] { OESHID, OESHTDL });
                OEISHDO.Compose(new View[] { OEISHID, OESHIDO });
                OEISHIDS.Compose(new View[] { OEISHID, OESHIDS });
                OEISHIDL.Compose(new View[] { OEISHID, OESHIDL });
                OEICOIS.Compose(new View[] { OEISHIH, OECOINS });
                OEISHHO.Compose(new View[] { OEISHIH, OESHIHO });

                OEISHIH.Init();
                OEISHIH.Fields.FieldByName("ORDNUMBER").SetValue(@"ORD000000000193", false);
                OEISHIH.Fields.FieldByName("CUSTOMER").SetValue(@"1100", false);
                
                OEISHID.RecordClear();            
                OEISHID.Fields.FieldByName("LINENUM").SetValue(32, false);            
                OEISHID.Fields.FieldByName("ORDNUMBER").SetValue(@"ORD000000000193", false);
                OEISHID.Fields.FieldByName("QTYSHIPPED").SetValue((decimal)2.0, false);
                OEISHID.Process();
                OEISHID.Insert();

                OEISHIH.Insert();

  • +1 in reply to Javier H
    verified answer

    Start with recording a macro of what you're trying to do.  The code above doesn't follow the correct logic.

    This is just the basics and still needs work:

    OESHI1header.Cancel
    OESHI1header.Init
    OESHI1headerFields("PROCESSCMD").PutWithoutVerification ("1")         ' Process OIP Command
    OESHI1header.Process

    OESHI1headerFields("ORDNUMBER").Value = "ORD000000000086"             ' Order Number
    OESHI1headerFields("SHIP1ORDER").Value = "1"                          ' Generate Ship. from Single Order
    OESHI1header.Process

    OESHI1detail1Fields("LINENUM").PutWithoutVerification ("-1")          ' Line Number
    OESHI1detail1.Read
    OESHI1detail1Fields("QTYSHIPPED").Value = "2.0000"                    ' Quantity Shipped
    OESHI1detail1.Update
    OESHI1headerFields("OECOMMAND").Value = "4"                           ' Process O/E Command
    OESHI1header.Process
    OESHI1header.Insert

  • 0 in reply to Django

    Thanks. I just went and click the Macro, did my thing. Copy paste the code a few changes and it worked! Thanks again. I was way off. Is that this "logical steps" are not that logical for me as I never used this before.

    I think with your help I can be on my way. Din't knew about that Macro Option.