Inbound Shipment

Inbound shipments provide visibility of in-transit inventory and the status of a shipment. Items from multiple purchase orders can be assigned to an incoming shipment and bulk received and billed from within the record. Accounting support is also provided for the transfer of ownership of inbound inventory prior to receipt, through the ownership transfer record.

The internal ID for this record is inboundshipment.

The inbound shipment record is available in NetSuite and NetSuite OneWorld accounts when the Inbound Shipment Management feature is enabled.

For help working with this record in the UI, see Inbound Shipment Management.

For information about scripting with this record in SuiteScript, see the following help topics:

Supported Script Types

The inbound shipment record is supported in client and server SuiteScript.

Supported Operations

This record can be created, read, updated, deleted, and searched using SuiteScript. It cannot be copied or transformed.

Usage Notes

A script that adds a line item to an inbound shipment should include both the purchase order ID and the line number for the item in the purchase order items sublist.

Field Definitions

See the SuiteScript Records Browser for all internal IDs associated with this record.

Note:

For information about using the SuiteScript Records Browser, see Working with the SuiteScript Records Browser in the NetSuite Help Center.

Code Sample

The following sample shows a typical workflow for an inbound shipment. This example does the following:

          var inboundShipment = record.create({
    type: record.Type.INBOUND_SHIPMENT,
    isDynamic: true
});
var purchaseOrder = record.load({
    type: record.Type.PURCHASE_ORDER,
    id: 1718,
    isDynamic: true
});
var itemLineCount = purchaseOrder.getLineCount({
    sublistId: 'item'
});
for (var i = 1; i <= itemLineCount; i++) {
    inboundShipment.selectNewLine({
        sublistId: 'items'
    });
    inboundShipment.setCurrentSublistValue({
        sublistId: 'items',
        fieldId: 'purchaseorder',
        value: purchaseOrder.get.Id()
    });
    inboundShipment.setCurrentSublistValue({
        sublistId: 'items',
        fieldId: 'shipmentitem',
        value: purchaseOrder.getSublistValue({
            sublistId: 'item',
            fieldId: 'lineuniquekey',
            line: i
        })
    });
    inboundShipment.commitLine({
        sublistId: 'items'
    });
}
var inboundShipmentId = inboundShipment.save();

var inboundShipmentUpdate = record.load({
    type: record.Type.INBOUND_SHIPMENT,
    id: inboundShipmentId,
    isDynamic: true
});
inboundShipmentUpdate.setValue({
    fieldId: 'shipmentstatus',
    value: 'inTransit'
});
inboundShipmentUpdate.setValue({
    fieldId: 'externaldocumentnumber',
    value: 'EDN645'
});
inboundShipmentUpdate.setValue({
    fieldId: 'expectedshippingdate',
    value: new Date('8/2/2017')
});
inboundShipmentUpdate.selectLine({
    sublistId: 'items',
    line: 1
});
inboundShipmentUpdate.setCurrentSublistValue({
    sublistId: 'items',
    fieldId: 'receivinglocation',
    value: 6
});
inboundShipmentUpdate.setCurrentSublistValue({
    sublistId: 'items',
    fieldId: 'quantityexpected',
    value: 1
});
inboundShipmentUpdate.setCurrentSublistValue({
    sublistId: 'items',
    fieldId: 'expectedrate',
    value: 10.5
});
inboundShipmentUpdate.commitLine({
    sublistId: 'items'
});
var recId = inboundShipmentUpdate.save();

var takeOwnership = record.load({
    type: record.Type.BULK_OWNERSHIP_TRANSFER,
    id: inboundShipmentId,
    isDynamic: true
});
takeOwnership.selectLine({
    sublistId: 'items',
    line: 2
});
takeOwnership.setCurrentSublistValue({
    sublistId: 'items',
    fieldId: 'process',
    value: 'F'
});
takeOwnership.commitLine({
    sublistId: 'items'
});
var recId2 = takeOwnership.save();

var bulkReceive = record.load({
    type: record.Type.RECEIVE_INBOUND_SHIPMENT,
    id: inboundShipmentId,
    isDynamic: true
});
bulkReceive.selectLine({
    sublistId: 'receiveitems',
    line: 2
});
bulkReceive.setCurrentSublistValue({
    sublistId: 'receiveitems',
    fieldId: 'quantitytobereceived',
    value: 1
});
bulkReceive.commitLine({
    sublistId: 'receiveitems'
});
var recId3 = bulkReceive.save(); 

        

Related Topics

General Notices