Contact Us

Adding addresses is a common task to be completed for a SuiteCommerce website and is quite easy once you know how to do it!

Managing customer addresses in NetSuite is a fundamental aspect of ensuring accurate order fulfillment and seamless customer interactions. In SuiteCommerce 2.x, leveraging SuiteScript 2.0 allows developers to programmatically add and manage addresses on customer records, streamlining operations and reducing manual data entry. This guide provides a step-by-step approach to adding addresses using SuiteScript 2.0, ensuring that your SuiteCommerce implementation handles customer address data efficiently and accurately.

Code Example: Add Addresses in SuiteCommerce

See the code example below.

/** * @param {Record Object} customer * @param {object} address */ function updateAddress(customer, address) { var currentAddressCount = customer.getLineCount({ sublistId: "addressbook", }); //either select a new line or select the desired line if (currentAddressCount === 0) { customer.selectNewLine({ sublistId: "addressbook", }); } else { customer.selectLine({ sublistId: "addressbook", line: 0, }); } //get the address subrecord var addressSubrecord = customer.getCurrentSublistSubrecord({ sublistId: "addressbook", fieldId: "addressbookaddress", }); // Set all required values here. addressSubrecord.setValue({ fieldId: "addr1", value: address.line_one, }); //commit the line, and don't forget to save! customer.commitLine({ sublistId: "addressbook", }); customer.save(); }

Conclusion

Incorporating address management through SuiteScript 2.0 in your SuiteCommerce implementation empowers you to automate and streamline customer data handling. This not only reduces the potential for human error but also ensures that customer information is consistently structured and readily available for transactions. By leveraging these scripting capabilities, SuiteCommerce developers can enhance the robustness and reliability of their NetSuite solutions, ultimately contributing to improved customer satisfaction and operational excellence.

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!

FREE SuiteCommerce Book

If you liked this article, you'll LOVE our book on SuiteCommerce! Order the free SuiteCommerce book today, and we'll even pay for shipping!

Anchor Group NetSuite Ecommerce SuiteCommerce Book

Oracle NetSuite Alliance Partner & Commerce Partner

If you have general questions about SuiteCommerce or more specific questions about how our team can support your business as you implement NetSuite or SuiteCommerce, feel free to contact us anytime. Anchor Group is a certified Oracle NetSuite Alliance Partner and Commerce Partner equipped to handle all kinds of NetSuite and SuiteCommerce projects, large or small!

Horizontal Anchor Group logo orange anchor icon navy Anchor Group text

We are a premium SuiteCommerce agency that creates powerful customer portals. Unlike our competitors, we have already solved your problems.

 

Tagged with Training