By default, NetSuite replaces every line when a user makes a change to one line on a transaction and selects the update Action. This can result in a loss of data, especially if you are not including all of the fields on your template and providing values for them,

This article shows how to update only select lines which may incrementally improve performance depending on the number of lines updated. We'll be making use of the replaceAll attribute. NOTE - this only applies to record types where keyed sublists appear such as Sales Orders, Invoices, Vendor Bills. Record types without keyed sublists such as Journal Entries Expense List will always remove all the lines and replace them with your values. To learn more about keyed and non keyed sublists see this NetSuite guide (search for replaceAll).

Understanding the replaceAll attribute

replaceAll = FALSE

  • Lines in the existing sublist are selectively updated with lines in the sublist submitted in the SOAP web services request.
    The newly submitted sublist need only include values to be added and updated.
  • Lines that do not match the newly submitted lines are preserved.
  • Currently existing lines that match lines in the new sublist submission are updated.
  • Newly submitted lines with no matches are added.

replaceAll = TRUE
The default value for the replaceAll attribute is TRUE

  • The existing sublist is replaced with the sublist submitted in the SOAP web services request.
    The newly submitted sublist should include all values.
  • Lines that do not match the newly submitted lines are removed.
  • Currently existing lines that match lines in the new sublist submission are updated.
  • Newly submitted lines with no matches are added.

Please read before moving forward
Do not just remove all lines you want to exclude from being updated without following the steps below. NetSuite's default behavior in this case would be to remove all lines and only keep the one being updated.

Updating Select Lines

Now that you have an understanding of the replaceAll attribute it's time to put it to good use. Users can choose to only update select lines and also retain existing values in fields not on the template by doing the following. Since data could be lost if this is not done properly we encourage you to start with a small data set.

  • Adding the following fields to the template
    For transactions with items add itemList.replaceAll and itemList.item.line
    For transactions without items add lineList.replaceAll and lineList.line.line
    (note -*.linerepresents the line number and is generally added by default when you load a template.)
  • Ensure that the line number has a value. If it does not you can use the refresh action to populate it.
  • Set the value of itemList.replaceAll or lineList.replaceAll to False for the lines you wish to update.
  • Optionally remove all the lines that do not require an update

Now, when an update is pushed back to NetSuite, only the lines sent will be updated. All other lines on the transaction record in NetSuite will not be processed. In addition, missing values will not be replaced.

Did this answer your question?