Sunday, December 23, 2018

Web Services: Initialize and Add an Item Fulfillment from a Sales Order using VB.NET

Developers using VB.NET can review code snippet below to create Web Service request to initialize and add an Item Fulfillment from a Sales Order.

Dim salesOrder As New InitializeRef()salesOrder.internalId = "4231" 'specify internal id salesOrder.type = InitializeRefType.salesOrdersalesOrder.typeSpecified = True       Dim itemFulfillment As New InitializeRecord()itemFulfillment.type = InitializeType.itemFulfillmentitemFulfillment.reference = salesOrderDim itemFulfillmentResponse As ReadResponse = service.initialize(itemFulfillment)Dim itemFulfillmentRecord As ItemFulfillment = DirectCast(itemFulfillmentResponse.record, ItemFulfillment)itemFulfillmentRecord.itemList.item(0).quantity = 1itemFulfillmentRecord.itemList.item(0).quantitySpecified = TrueDim response As WriteResponse = service.add(itemFulfillmentRecord)

Note: "service" is an instance of NetSuiteService and must be declared and instantiated accordingly.

No comments:

Post a Comment