Thursday, October 11, 2018

Web Services: Initialize and Add an Item Fulfillment from a Sales Order using JAVA

The code snippet below shows how to initialize and add a Item Fulfillment from a Sales Order using JAVA.

InitializeRef salesOrder = new InitializeRef();
salesOrder.setInternalId("123"); //specify internal id

salesOrder.setType(InitializeRefType.salesOrder);

InitializeRecord itemFulfillment = new InitializeRecord();
itemFulfillment.setType(InitializeType.itemFulfillment);
itemFulfillment.setReference(salesOrder);

ReadResponse itemFulfillmentResponse = _port.initialize(itemFulfillment);

ItemFulfillment itemFulfillmentRecord = (ItemFulfillment) itemFulfillmentResponse.getRecord();

WriteResponse response = _port.add(itemFulfillmentRecord);



Note: "_port" is an instance of NetSuitePortType and must be declared and instantiated accordingly.

No comments:

Post a Comment