Use "forceSyncSourcing" to Resolve Line Item Issues in SuiteScripts

in , , November 6th, 2024
a person is typing on a computer keyboard

Line Item Issues in Client Scripts

Working with line items can often be tricky. This is especially the case with Client Scripts. Utilize the “forceSyncSourcing” attribute to help the Client Script code to act the same as manual actions in the UI.

About Using "forceSyncSourcing" in SuiteScript

“forceSyncSourcing” is an attribute that can be passed in the “setValue”, “setSublistValue”, and “setCurrentSublistValue“ functions referenced above. It defaults to false, but if set to true, forces the line field sources to occur synchronously. This is slower but often leads to a simpler script that ensures the lines are added with the appropriate data.

"forceSyncSourcing" Code Sample for SuiteScript

Adding this attribute has resolved issues in Clients Scripts many times.

currentRecord.setCurrentSublistValue({
    sublistId: "item",
    fieldId: "item",
    value: someitemId,
    forceSyncSourcing: true
});

Author: Sam Gagliardi


Got stuck on a step in 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