in client script on a sales order if you change th...
# ask-stanley-ai
b
in client script on a sales order if you change the shipping address to a custom address and set all the fields, the address subrecord is updated but the screen display is not. how can i update the screen display
c
AI generated answer (using internal Slack threads):
Based on the conversations, it seems that the issue is related to updating the shipping address on a sales order using a client script in NetSuite. The address subrecord is updated, but the screen display is not. One possible solution is to use SuiteScript 1.0 instead of SuiteScript 2.0 for this purpose. SuiteScript 1.0 explicitly allows you to commit the shipping address. Here is a sample code snippet:
Copy code
javascript
var salesorder = window.nlapiLoadRecord('salesorder', saleID)
salesorder.setFieldValue('shipcity', 'San Mateo')
salesorder.setFieldValue('shipstate', 'CA')
salesorder.setFieldValue('shipzip', '94403')
window.nlapiSubmitRecord(salesorder)
However, please note that you might encounter 'record changed' errors if you change the current record by loading and saving it. This is equivalent to opening the record in a new window and making changes there. Another approach is to use the
nlapiEditSubrecord(fldname)
or
nlapiCreateSubrecord(fldname)
functions to set your address fields, and then commit the subrecord. Here is the relevant documentation: [nlapiEditSubrecord](https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3035888.html#bridgehead_N3036670), [nlapiCreateSubrecord](https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3035888.html#bridgehead_N3036333), [address fields](https://system.netsuite.com/app/help/helpcenter.nl?fid=section_4071771449.html), [commit the subrecord](https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N2941460.html). Please note that the documentation generally states that subrecords are not supported client-side, but it does work for now. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.862121463
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.848571777
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.847961307
Please provide your feedback on this answer.