Writing to Orderful Packaging Records
WMS Integration: EDI Carton and Packed Item Custom Records
This document provides complete technical specifications for the EDI Carton and Shipped Item (Packed Item) custom records. WMS integration developers can use this reference to write packing and carton data directly to NetSuite.
Overview
The Orderful NetSuite Connector uses two custom records to store package-level shipping data:
| Record | Script ID | Purpose |
|---|---|---|
| EDI Carton | customrecord_orderful_carton | Represents a physical package (carton or pallet) being shipped |
| Shipped Item | customrecord_orderful_shipped_item | Represents individual items packed within a carton |
These records are used to generate EDI 856 (Advanced Shipment Notice) documents and support GS1 compliance with SSCC-18 barcodes.
Record Relationships
Item Fulfillment (NetSuite Standard Record)
│
├── EDI Carton (1:many)
│ │
│ ├── Shipped Items (1:many) - Items packed in this carton
│ │
│ └── Child Cartons (optional) - For pallet/carton hierarchy
│ │
│ └── Shipped Items (1:many)
Key Relationships:
- Each EDI Carton must be linked to an Item Fulfillment record
- Shipped Items are child records of EDI Cartons
- Cartons can have a parent carton (for pallet hierarchies)
- The
fulfillmentfield on Shipped Item must match thefulfillmentfield on its parent Carton
EDI Carton Record
Record Type ID: customrecord_orderful_carton
Label: EDI Carton
Field Reference
| Field Label | Field ID | Type | Required | Max Length | Description |
|---|---|---|---|---|---|
| Item Fulfillment | custrecord_orderful_carton_fulfillment | SELECT | Yes | - | Reference to the parent Item Fulfillment record. This is the primary relationship field. |
| Is Pallet/Tare | custrecord_orderful_carton_is_pallet | CHECKBOX | Yes | - | Indicates if this record represents a pallet or tare package. Pallet packages can be used as parents of other packages. Default: F |
| Length | custrecord_orderful_carton_length | FLOAT | No | - | Package length in inches |
| Width | custrecord_orderful_carton_width | FLOAT | No | - | Package width in inches |
| Height | custrecord_orderful_carton_height | FLOAT | No | - | Package height in inches |
| Weight | custrecord_orderful_carton_weight | FLOAT | No | - | Package weight in pounds (lbs) |
| Custom Serial | custrecord_orderful_carton_custom_serial | TEXT | No | 20 | Custom serial number. Use this if you want to override the auto-generated record number. |
| Parent Carton | custrecord_orderful_carton_pallet | SELECT | No | - | Reference to another EDI Carton record (self-referential). Used to create pallet/carton hierarchies. |
| Tracking Number | custrecord_orderful_carton_tracking | TEXT | No | - | Carrier tracking number for this package |
| Transit Days | custrecord_orderful_carton_transit_days | INTEGER | No | - | Estimated transit days for delivery |
| Pallet Tiers | custrecord_orderful_carton_tiers | INTEGER | No | - | Number of tiers (layers) on the pallet. Only applicable when Is Pallet/Tare is checked. |
| Pallet Blocks | custrecord_orderful_carton_blocks | INTEGER | No | - | Number of blocks on the pallet. Only applicable when Is Pallet/Tare is checked. |
| SSCC18 | custrecord_orderful_carton_sscc18 | TEXT | No | - | Serial Shipping Container Code (18-digit GS1 standard barcode). Note: This field has LOCKED display type - it is displayed but typically set programmatically. |
Standard Fields
| Field | Description |
|---|---|
| ID | NetSuite internal ID (auto-generated) |
| Name | Auto-generated serial number with 6-digit minimum (e.g., 000001). Can be overridden via the altname field. |
Record Configuration Notes
- Numbering: Enabled with 6-digit minimum padding
- Inline Editing: Allowed
- Optimistic Locking: Enabled
- Parent Subtab: Cartons appear on Item Fulfillment records under the custom subtab
custtab_orderful_transaction
Shipped Item Record (Packed Items)
Record Type ID: customrecord_orderful_shipped_item
Label: Shipped Item
Field Reference
| Field Label | Field ID | Type | Required | Description |
|---|---|---|---|---|
| Item | custrecord_orderful_shipped_item | SELECT | No | Reference to a NetSuite Item record (internal ID -10). The item being packed. |
| Carton | custrecord_orderful_shipped_carton | SELECT | No | Reference to the parent EDI Carton record. Important: This field is filtered to only show cartons that match the Shipped Item's fulfillment. |
| Quantity | custrecord_orderful_shipped_quantity | FLOAT | No | Quantity of the item packed in this carton |
| Fulfillment | custrecord_orderful_shipped_fulfillment | SELECT | No | Reference to the Item Fulfillment record. Must match the fulfillment on the parent Carton for proper filtering. |
| Lot Serial Number | custrecord_orderful_lot_serial_number | TEXT | No | Lot number or serial number for this packed item. Used for lot/serial tracking in EDI documents. |
| Expiry Date | custrecord_orderful_item_expiry_date | DATE | No | Expiration/best-by date of the shipped item |
Record Configuration Notes
- Numbering: Disabled (no auto-generated numbers)
- Inline Editing: Allowed
- Attachments: Allowed
- Parent Subtab: Shipped Items appear on EDI Carton records under the
orderful_carton_itemssubtab
Writing to These Records
Method 1: Using NetSuite Record API (SuiteScript 2.x)
Creating an EDI Carton with Packed Items
/**
* @NApiVersion 2.1
*/
define(['N/record'], function(record) {
function createCartonWithItems(fulfillmentId, cartonData, items) {
// Create the carton record
var cartonRecord = record.create({
type: 'customrecord_orderful_carton'
});
// Set required fields
cartonRecord.setValue({
fieldId: 'custrecord_orderful_carton_fulfillment',
value: fulfillmentId
});
cartonRecord.setValue({
fieldId: 'custrecord_orderful_carton_is_pallet',
value: cartonData.isPallet || false
});
// Set optional dimension fields
if (cartonData.length) {
cartonRecord.setValue({
fieldId: 'custrecord_orderful_carton_length',
value: cartonData.length
});
}
if (cartonData.width) {
cartonRecord.setValue({
fieldId: 'custrecord_orderful_carton_width',
value: cartonData.width
});
}
if (cartonData.height) {
cartonRecord.setValue({
fieldId: 'custrecord_orderful_carton_height',
value: cartonData.height
});
}
if (cartonData.weight) {
cartonRecord.setValue({
fieldId: 'custrecord_orderful_carton_weight',
value: cartonData.weight
});
}
// Set tracking number if provided
if (cartonData.trackingNumber) {
cartonRecord.setValue({
fieldId: 'custrecord_orderful_carton_tracking',
value: cartonData.trackingNumber
});
}
// Set custom serial if provided
if (cartonData.customSerial) {
cartonRecord.setValue({
fieldId: 'custrecord_orderful_carton_custom_serial',
value: cartonData.customSerial
});
}
// Set SSCC if provided
if (cartonData.sscc) {
cartonRecord.setValue({
fieldId: 'custrecord_orderful_carton_sscc18',
value: cartonData.sscc
});
}
// Set parent carton for pallet hierarchy
if (cartonData.parentCartonId) {
cartonRecord.setValue({
fieldId: 'custrecord_orderful_carton_pallet',
value: cartonData.parentCartonId
});
}
// Add packed items via sublist
var sublistId = 'recmachcustrecord_orderful_shipped_carton';
items.forEach(function(item, index) {
cartonRecord.setSublistValue({
sublistId: sublistId,
fieldId: 'custrecord_orderful_shipped_fulfillment',
line: index,
value: fulfillmentId
});
cartonRecord.setSublistValue({
sublistId: sublistId,
fieldId: 'custrecord_orderful_shipped_item',
line: index,
value: item.itemId
});
cartonRecord.setSublistValue({
sublistId: sublistId,
fieldId: 'custrecord_orderful_shipped_quantity',
line: index,
value: item.quantity
});
// Optional: lot/serial number
if (item.lotSerialNumber) {
cartonRecord.setSublistValue({
sublistId: sublistId,
fieldId: 'custrecord_orderful_lot_serial_number',
line: index,
value: item.lotSerialNumber
});
}
// Optional: expiry date
if (item.expiryDate) {
cartonRecord.setSublistValue({
sublistId: sublistId,
fieldId: 'custrecord_orderful_item_expiry_date',
line: index,
value: item.expiryDate
});
}
});
// Save and return the carton ID
return cartonRecord.save({
ignoreMandatoryFields: true
});
}
return {
createCartonWithItems: createCartonWithItems
};
});Creating Records Separately
/**
* Create carton and items as separate operations
*/
define(['N/record'], function(record) {
function createCarton(fulfillmentId, cartonData) {
var cartonRecord = record.create({
type: 'customrecord_orderful_carton'
});
cartonRecord.setValue({
fieldId: 'custrecord_orderful_carton_fulfillment',
value: fulfillmentId
});
cartonRecord.setValue({
fieldId: 'custrecord_orderful_carton_is_pallet',
value: cartonData.isPallet || false
});
// Set other fields as needed...
return cartonRecord.save();
}
function createShippedItem(fulfillmentId, cartonId, itemData) {
var shippedItemRecord = record.create({
type: 'customrecord_orderful_shipped_item'
});
shippedItemRecord.setValue({
fieldId: 'custrecord_orderful_shipped_fulfillment',
value: fulfillmentId
});
shippedItemRecord.setValue({
fieldId: 'custrecord_orderful_shipped_carton',
value: cartonId
});
shippedItemRecord.setValue({
fieldId: 'custrecord_orderful_shipped_item',
value: itemData.itemId
});
shippedItemRecord.setValue({
fieldId: 'custrecord_orderful_shipped_quantity',
value: itemData.quantity
});
if (itemData.lotSerialNumber) {
shippedItemRecord.setValue({
fieldId: 'custrecord_orderful_lot_serial_number',
value: itemData.lotSerialNumber
});
}
if (itemData.expiryDate) {
shippedItemRecord.setValue({
fieldId: 'custrecord_orderful_item_expiry_date',
value: itemData.expiryDate
});
}
return shippedItemRecord.save();
}
return {
createCarton: createCarton,
createShippedItem: createShippedItem
};
});Method 2: Using SuiteQL
Querying Existing Cartons and Items
-- Query all cartons for a specific fulfillment
SELECT
c.id AS carton_id,
c.name AS carton_name,
c.custrecord_orderful_carton_fulfillment AS fulfillment_id,
c.custrecord_orderful_carton_length AS length,
c.custrecord_orderful_carton_width AS width,
c.custrecord_orderful_carton_height AS height,
c.custrecord_orderful_carton_weight AS weight,
c.custrecord_orderful_carton_is_pallet AS is_pallet,
c.custrecord_orderful_carton_tracking AS tracking_number,
c.custrecord_orderful_carton_sscc18 AS sscc18,
c.custrecord_orderful_carton_pallet AS parent_carton_id
FROM
customrecord_orderful_carton c
WHERE
c.custrecord_orderful_carton_fulfillment = ?-- Query packed items with carton details
SELECT
si.id AS shipped_item_id,
si.custrecord_orderful_shipped_item AS item_id,
si.custrecord_orderful_shipped_quantity AS quantity,
si.custrecord_orderful_shipped_carton AS carton_id,
si.custrecord_orderful_lot_serial_number AS lot_serial,
si.custrecord_orderful_item_expiry_date AS expiry_date,
c.name AS carton_name,
c.custrecord_orderful_carton_sscc18 AS carton_sscc
FROM
customrecord_orderful_shipped_item si
LEFT JOIN customrecord_orderful_carton c
ON si.custrecord_orderful_shipped_carton = c.id
WHERE
si.custrecord_orderful_shipped_fulfillment = ?Method 3: Using REST Web Services
If using NetSuite's REST API, use the following endpoint patterns:
Create Carton:
POST /services/rest/record/v1/customrecord_orderful_carton
Create Shipped Item:
POST /services/rest/record/v1/customrecord_orderful_shipped_item
Example: Complete Pallet with Cartons
This example shows how to create a pallet containing multiple cartons, each with packed items:
/**
* Creates a complete pallet hierarchy:
* - 1 Pallet (parent carton with isPallet=true)
* - 2 Cartons on the pallet
* - Items in each carton
*/
define(['N/record'], function(record) {
function createPalletWithCartons(fulfillmentId) {
// Step 1: Create the pallet (parent carton)
var palletRecord = record.create({
type: 'customrecord_orderful_carton'
});
palletRecord.setValue({
fieldId: 'custrecord_orderful_carton_fulfillment',
value: fulfillmentId
});
palletRecord.setValue({
fieldId: 'custrecord_orderful_carton_is_pallet',
value: true // This is a pallet
});
palletRecord.setValue({
fieldId: 'custrecord_orderful_carton_length',
value: 48 // Standard pallet length
});
palletRecord.setValue({
fieldId: 'custrecord_orderful_carton_width',
value: 40 // Standard pallet width
});
palletRecord.setValue({
fieldId: 'custrecord_orderful_carton_height',
value: 60
});
palletRecord.setValue({
fieldId: 'custrecord_orderful_carton_weight',
value: 500
});
palletRecord.setValue({
fieldId: 'custrecord_orderful_carton_tiers',
value: 5 // 5 tiers on this pallet
});
palletRecord.setValue({
fieldId: 'custrecord_orderful_carton_blocks',
value: 4 // 4 blocks per tier
});
var palletId = palletRecord.save();
// Step 2: Create first carton on the pallet
var carton1Id = createCartonOnPallet(fulfillmentId, palletId, {
length: 12,
width: 12,
height: 12,
weight: 25,
trackingNumber: '1Z999AA10123456784'
}, [
{ itemId: 123, quantity: 10, lotSerialNumber: 'LOT-001' },
{ itemId: 456, quantity: 5, lotSerialNumber: 'LOT-002' }
]);
// Step 3: Create second carton on the pallet
var carton2Id = createCartonOnPallet(fulfillmentId, palletId, {
length: 12,
width: 12,
height: 12,
weight: 30,
trackingNumber: '1Z999AA10123456785'
}, [
{ itemId: 789, quantity: 20 }
]);
return {
palletId: palletId,
cartonIds: [carton1Id, carton2Id]
};
}
function createCartonOnPallet(fulfillmentId, palletId, cartonData, items) {
var cartonRecord = record.create({
type: 'customrecord_orderful_carton'
});
cartonRecord.setValue({
fieldId: 'custrecord_orderful_carton_fulfillment',
value: fulfillmentId
});
cartonRecord.setValue({
fieldId: 'custrecord_orderful_carton_is_pallet',
value: false // This is a carton, not a pallet
});
cartonRecord.setValue({
fieldId: 'custrecord_orderful_carton_pallet',
value: palletId // Link to parent pallet
});
// Set dimensions
if (cartonData.length) {
cartonRecord.setValue({
fieldId: 'custrecord_orderful_carton_length',
value: cartonData.length
});
}
if (cartonData.width) {
cartonRecord.setValue({
fieldId: 'custrecord_orderful_carton_width',
value: cartonData.width
});
}
if (cartonData.height) {
cartonRecord.setValue({
fieldId: 'custrecord_orderful_carton_height',
value: cartonData.height
});
}
if (cartonData.weight) {
cartonRecord.setValue({
fieldId: 'custrecord_orderful_carton_weight',
value: cartonData.weight
});
}
if (cartonData.trackingNumber) {
cartonRecord.setValue({
fieldId: 'custrecord_orderful_carton_tracking',
value: cartonData.trackingNumber
});
}
// Add items via sublist
var sublistId = 'recmachcustrecord_orderful_shipped_carton';
items.forEach(function(item, index) {
cartonRecord.setSublistValue({
sublistId: sublistId,
fieldId: 'custrecord_orderful_shipped_fulfillment',
line: index,
value: fulfillmentId
});
cartonRecord.setSublistValue({
sublistId: sublistId,
fieldId: 'custrecord_orderful_shipped_item',
line: index,
value: item.itemId
});
cartonRecord.setSublistValue({
sublistId: sublistId,
fieldId: 'custrecord_orderful_shipped_quantity',
line: index,
value: item.quantity
});
if (item.lotSerialNumber) {
cartonRecord.setSublistValue({
sublistId: sublistId,
fieldId: 'custrecord_orderful_lot_serial_number',
line: index,
value: item.lotSerialNumber
});
}
});
return cartonRecord.save({ ignoreMandatoryFields: true });
}
return {
createPalletWithCartons: createPalletWithCartons
};
});Data Validation Requirements
When writing to these records, ensure:
-
Fulfillment Consistency: The
fulfillmentfield on Shipped Items must match thefulfillmentfield on the parent Carton -
Item References: Item internal IDs must reference valid NetSuite Item records
-
Pallet Hierarchy:
- Only cartons with
custrecord_orderful_carton_is_pallet = trueshould be used as parent cartons - A carton cannot be its own parent
- Only cartons with
-
SSCC-18 Format: If providing SSCC values, use the standard 18-digit GS1 format
-
Dimension Units:
- Length, Width, Height: inches
- Weight: pounds (lbs)
Field ID Quick Reference
EDI Carton Fields
| Purpose | Field ID |
|---|---|
| Fulfillment (Required) | custrecord_orderful_carton_fulfillment |
| Is Pallet (Required) | custrecord_orderful_carton_is_pallet |
| Length | custrecord_orderful_carton_length |
| Width | custrecord_orderful_carton_width |
| Height | custrecord_orderful_carton_height |
| Weight | custrecord_orderful_carton_weight |
| Custom Serial | custrecord_orderful_carton_custom_serial |
| Parent Carton | custrecord_orderful_carton_pallet |
| Tracking Number | custrecord_orderful_carton_tracking |
| Transit Days | custrecord_orderful_carton_transit_days |
| Pallet Tiers | custrecord_orderful_carton_tiers |
| Pallet Blocks | custrecord_orderful_carton_blocks |
| SSCC18 | custrecord_orderful_carton_sscc18 |
Shipped Item Fields
| Purpose | Field ID |
|---|---|
| Item | custrecord_orderful_shipped_item |
| Carton | custrecord_orderful_shipped_carton |
| Quantity | custrecord_orderful_shipped_quantity |
| Fulfillment | custrecord_orderful_shipped_fulfillment |
| Lot/Serial Number | custrecord_orderful_lot_serial_number |
| Expiry Date | custrecord_orderful_item_expiry_date |
Sublist ID for Inline Item Creation
When creating items inline with a carton:
recmachcustrecord_orderful_shipped_carton
Support
For questions about integrating with these custom records, contact your Orderful implementation team.
Updated 1 day ago
