Unable to Set the Weight Field on Line Items - NetSuite SuiteScript

in , , February 2nd, 2024
person using laptop

Problem: Locked Weight Field

When writing a SuiteScript, you may have come across the problem where the native “weight” field on line items does not seem to change when you set it with a SuiteScript.

For example:

recordObject.setSublistValue({
    sublistId: 'item',
    fieldId: 'weight',
    line: i,
    value: 0
});

It turns out that you can never overwrite this field because its value is sourced from the item record in NetSuite.

NetSuite either ignores the script when it tries to set the field or resets it after saving during post-processing (likely when calculating shipping). While we aren’t sure of the exact cause, the takeaway is the 'weight' field is effectively locked.

Solutions to Try

As with many errors like this, there are a few different ways to approach resolving this issue. Workarounds may include:

  1. Using a custom field to hold weight info
  2. Running scripts on item records to update weights

Author: Sam Gagliardi


Get stuck in a step during this article?

We like to update our blogs and articles to make sure they help resolve any troubleshooting difficulties you are having. Sometimes, there is a related feature to enable or a field to fill out that we miss during the instructions. If this article didn't resolve the issue, please use the chat and let us know so that we can update this article!

 
 

Want to keep learning?

Our team of NetSuite professionals has written articles on a wide variety of NetSuite topics, from SuiteCommerce tips, to recommended NetSuite solutions, to available support services, and more! 

Your cart