A line item in NetSuite can be thought of as a record having 1:N relationships with other records. It is like a sublist, or a list of lines within a record. For example, a Sales Order has a one-to-many relationship with Items.
You can access line items using the sublist name. In import mapping , each sublist is populated in the format Sublist Name : Field Name, such as Items : Department.
Select the line item to map the source data to this field:
Pro Tip: You can use line-level lookups as well to find data related to that specific line.
To find an existing line in NetSuite, it helps to understand the logic that integrator.io uses to decide whether the line needs to be created or updated:
- Search for key fields to find an existing line. For example, if you have a Sales Order, integrator.io tries to use the Item as a key field and find a line with the matching item value.
- If that Item cannot be found in the existing record, integrator.io will create a line.
- If a matching line item exists, integrator.io will update this line with the information that you provide.
In some cases, you might already have the line identifier (Line ID in NetSuite), which is unique for each line. Then, when mapping the Line ID for a sublist, integrator.io will use the Line ID to try to find and update that line; if no matching Line ID is found, one is created.
Resolve “Multiple lines found with keys itemkey=…”
On an item fulfillment, integrator.io matches each mapped row to an existing line by the item unless you set a key field. If two lines on the fulfillment carry the same item, integrator.io can’t tell which line a row belongs to, and the record fails with the error Multiple lines found with keys itemkey=… (error code MULTIPLE_LINES_WITH_SAME_KEYS).
Same item on two order lines
Key each row on the sales order line it came from:
- Add an import field mapping and type
item[*].orderlineas the NetSuite field. This field doesn’t appear in the mapping list, so you must enter it. - Map the sales order line ID from your source data to it.
- Click Settings on the mapping and check Use as a key field to find existing lines.
Note: Items : Line ID is the fulfillment’s own line number. It matches the sales order’s line ID only on a fresh, complete fulfillment, so it isn’t a reliable key for partial or repeated fulfillments.
Same item as a component of two kits
On an item fulfillment, NetSuite lists each kit line followed by its lot- or serial-tracked component lines. Each component line has its own line ID, and the inventory detail belongs on the component lines, not on the kit line. If you key the component rows on the kit’s line ID (as Items : Line ID or as the order line), integrator.io selects the kit line instead, and the save fails with You cannot create an inventory detail for this item.
If your source data knows only the kit’s order line (typical for warehouse and 3PL systems):
- Keep Items : Item as a key field.
- Add a mapping for
item[*].kitmemberof(type it in), map the kit’s order line ID to it, and check Use as a key field to find existing lines. Both keys must match, so the same component under two different kits resolves to two different lines. - Keep the kit rows in your item list. They mark the kit as fulfilled; without them, NetSuite fails the save with
You must enter at least one line item for this transaction. - On the kit rows, map Items : Ignore Current Line Inventory Details so no inventory detail is written on the kit line.
- Build the inventory detail subrecord from each component row’s own picks.
If your source data can supply each component line’s own order line ID, you can instead key every row on item[*].orderline as described previously.
You can also instruct integrator.io to use a custom or standard field to find an existing line.
Let’s say that you have a custom field called eTail order Line ID, which is unique for all the lines in that record. You can use this field to find a matching line with the field value:
- For the mapping to eTail order Line ID , click the Settings button.
- In the resulting Settings pane, check Use as a key field to find existing lines.
- Click Save.
When the key field option is enabled, integrator.io tries to match the field value from the source data against the field value in NetSuite lines. If it finds a match, that line will be updated; otherwise, a new line will be inserted.
In some cases, the source data may contain the complete order instead of just the delta changes. In others, some lines might be removed from the source system that are still in your NetSuite line items. Nonetheless, you might want to remove all the existing lines and add all the lines from your source data into NetSuite.
To enable this setting, add a new import field mapping for Items : Replace All Lines , and hard-code the value to True. Each sublist on the parent record should have a similarly named mapping option available.
Note
If an item already exists on the record in NetSuite, integrator.io only updates the record. If the item doesn't exist, integrator.io replaces all lines and adds new items. To replace all lines every time, use an alternate identifier that is certain not to already have existing lines. Check the Use as key to find existing lines checkbox on the import field that you want to use as the identifier..