How to create an Item Fulfillment for partial lines of a Sales Order (based on lineuniquekey)?

Hi!

In Celigo, I want to create Item Fulfillments from Sales Orders, but I need to fulfill only specific line items, not the entire order.

A typical Sales Order might have multiple lines like:

Item 1  (index 0)  
Item 2  (index 1)  
Item 3  (index 2)

These Sales Orders are generated from another system (let’s call it “x”). That same system can later send an Item Fulfillment request for only a partial set of lines — for example, just line 3.

For this scenario, I have:

  • The NetSuite internal line unique ID (lineuniquekey, e.g. "61753")
  • The external system’s line ID
  • Both are stored and mapped correctly

What I'm trying to do:

Transform a Sales Order into an Item Fulfillment and fulfill only the matching line, based on the known lineuniquekey.


Current Mapping in Celigo (Preview Payload):

{
  "nlobjFieldIds": {
    "celigo_nlobjTransformId": 29669,
    "custbody_tek_x_work_order_id": "29669",
    "custbody_tek_bill_id_see_description": "2157"
  },
  "nlobjSublistIds": {
    "item": {
      "lines": [
        {
          "line": 2,
          "quantity": "1",
          "custcol_tek_x_line_id": "7956",
          "custcol_tek_x_bill_header_id": "2157",
          "_keys": ["custcol_tek_x_line_id"]
        }
      ]
    }
  }
}

What NetSuite is doing (logged request):

r = NRecord.transform({ fromType: "salesorder", fromId: 29669, toType: "itemfulfillment" });
r.setValue({ fieldId: "custbody_tek_x_work_order_id", value: "29669" });
r.setValue({ fieldId: "custbody_tek_bill_id_see_description", value: "2156" });
r.setSublistValue({ sublistId: "item", fieldId: "itemreceive", line: 0, value: false });
r.setSublistValue({ sublistId: "item", fieldId: "itemreceive", line: 1, value: false });
r.setSublistValue({ sublistId: "item", fieldId: "itemreceive", line: 2, value: false });

But I get this error:

SSS_INVALID_SUBLIST_OPERATION  
"You have attempted an invalid sublist or line item operation. You are either trying to access a field on a non-existent line or you are trying to add or remove lines from a static sublist."

My assumption:

  • I used "line": 2 in the payload assuming it referred to the 3rd line from the original Sales Order.
  • However, this doesn’t always match the actual line index in the transformed fulfillment — especially if NetSuite reorders or filters the item lines.
  • I also tried using the correct lineuniquekey (61753), but the same error occurred.
  • The final request to NetSuite still shows all 3 item lines with itemreceive: false, even when I intend to fulfill only one.

Any advice from others who’ve implemented partial line fulfillments in Celigo. Thanks!

NetSuite was throwing the SSS_INVALID_SUBLIST_OPERATION error because I was sending "line": 2 in the Celigo payload. Line numbers from the Sales Order do not match the line numbers on the transformed Item Fulfillment — NetSuite only includes fulfillable lines, and the indexes shift.

Fix:
Remove the "line" field entirely. Let Celigo match the correct line using a unique key (e.g., custcol_tek_x_line_id) via _keys.

Working example:

{
  "nlobjSublistIds": {
    "item": {
      "lines": [
        {
          "custcol_tek_x_line_id": "7956",
          "itemreceive": true,
          "_keys": ["custcol_tek_x_line_id"]
        }
      ]
    }
  }
}

Once I removed "line", the Item Fulfillment worked and only the intended line was fulfilled.

There’s no need to create a custom unique line id, the standard NetSuite ‘Line Id’ is best for this. But there are a few things to make sure are set correctly:

When sending your SO/PO to the external system, make sure you send the Line Id field as your line reference. Don’t use line Sequence Number or Line Unique Key. The Line Id does not change for Item lines after create. Make sure this reference also makes it back to the IF/IR message. Don’t trust the external systems line number or Id to match.

When creating the IF/IR in NetSuite or Celigo using a Transform , the field ‘line ID’ (id: line) will match the Line Id of the Order before the record is saved:

Here is an example PO with line Ids 1,2,4

When you create the Receipt/Fulfillment, before saving, the line Id is still the line id of the Order, so you can use that field as the key field to match the line:

(this also applies when updating an existing receipt/fulfilment!)

It’s only after saving the record or when reading with a saved search the line id will take on the actual line id of the IF/IR:

If you want to read the Order Line Id from a Fulfillment/receipt using a Search, use the join to ‘Applied to transaction : Line ID‘ to get the id:

Extra bonus: when creating a Receipt for a Transfer order, NetSuite exposes field ‘itemshipline’ which is the line id from the IF. This is not visible in the ui, but you can map to it using Celigo and use it as key.