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.
Contents
How to map line 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.
Update existing lines
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.
Provide a custom field as a key value to find a line item
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.
Replace all lines in a record
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..
Comments
9 comments
Are there any details related to the Items : Create Line mapping that could be shared?
Hi, Stephen Lemp. You ask a good question that I don't have a ready answer for, in terms of use cases and NetSuite behavior. Our developers identified it at first glance as a "legacy" mapping function, and we hope to get back to you with more details after looking into it further.
Hi guys
I did the mapping above for save in the "mediaitem" sublist but the NetSuite is returning: "[{"statusCode":422,"errors":[{"source":"application","code":"SSS_INVALID_SUBLIST_OPERATION","message":"Failed to create, update/transform record because 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.". Tip: Please make sure that all the line items that you're trying to use exist on the record."}]}]"
Hi, Danilo Marques. Sorry, but it's impossible to tell from here whether you're running into issues with the integration or NetSuite setup. My recommendation is that you sign up for an office hours session where one of our solution consultants can provide guidance and look at your mappings and NetSuite account.
Is it possible to use the "Use as a key field to find existing lines" flag on multiple fields? For example, for item fulfillments, I want to match on the line ID and the item name (to address occasional item substitutions, and I want to make sure we catch an exception where the warehouse substituted an item without the order being modified in NetSuite). Thanks!
Hi, Stefan Podell. I apologize for the delay, while I checked with the development team. One of our resident NetSuite experts confirmed your solution:
Thank you, Stephen Brandt!
Stephen, do you have any additional documentation on the fields needed and how to map them to create a work order that has multiple line items? Following the information on this document does not give me much insight into how to build it. I can successfully create the work order; I'm mapping the item to items: Item(Name) and quantity to items: quantity BUT when i run it it creates multiple Work orders vs my expectation to create 1 work order with 2 items on it. Can you help?
Hi there, Robert Aguilera. I am so sorry for not replying sooner. I had sent out a request internally, but lacking a Data Loader integration that could reproduce this issue, a solution wasn't forthcoming. The advice was to submit a support ticket, which I see that you're already pursuing. I'm hoping for a quick resolution for you and (selfishly) a tip that could improve this article.
Please sign in to leave a comment.