Saturday, December 22, 2018

Web Services: Initialize and Add a Vendor Bill from a Purchase Order using VB.NET

The code snippet below shows how to initialize and add a Vendor Bill from a Purchase Order using VB.NET.

Dim purchaseOrder As New InitializeRefpurchaseOrder.internalId = "1234" 'specify internal idpurchaseOrder.type = InitializeRefType.purchaseOrderpurchaseOrder.typeSpecified = TrueDim vendorBill As New InitializeRecordVendorBill.type = InitializeType.vendorBillvendorBill.reference = purchaseOrderDim vendorBillResponse As ReadResponse = service.initialize(vendorBill)Dim vendorBillRecord As VendorBill = DirectCast(vendorBillResponse.record, VendorBill)Dim location As New RecordRef()location.internalId = "1"location.type = RecordType.locationlocation.typeSpecified = TruevendorBillRecord.itemList.item(0).location = locationDim response As WriteResponse = service.add(vendorBillRecord)

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

No comments:

Post a Comment