RE: Setting the country via SuiteScript
Hello,
I have a Map/Reduce script that creates sales orders based on values in an external database.
This works great for orders shipping to the US, but occasionally this script needs to create orders for Canada.
When I create a Canada order in the UI, the address pop-up reloads after I change the country, and the whole SO entry page reloads after I save the address.
When I create the SO via script (dynamic mode) I get this unexpected error on save that, to me, implies it’s running into issues when trying to reload the form:
{"type":"error.SuiteScriptError","name":"UNEXPECTED_ERROR","message":"An unexpected error has occurred","stack":["nlapiChangeCall(NLRecordScripting.scriptInit:2214)","change_form_due_to_address_change(NLRecordScripting.scriptInit:13305)","validate_custom_shipaddress_change(NLRecordScripting.scriptInit:13357)","(NLRecordScripting.scriptInit:14302)","page_init(NLRecordScripting.scriptInit:14296)","nlapiChangeCall(NLRecordScripting.scriptInit:2214)","change_form_due_to_address_change(NLRecordScripting.scriptInit:13305)","validate_custom_shipaddress_change(NLRecordScripting.scriptInit:13357)","(NLRecordScripting.scriptInit:14302)","page_init(NLRecordScripting.scriptInit:14296)","nlapiChangeCall(NLRecordScripting.scriptInit:2214)","change_form_due_to_address_change(NLRecordScripting.scriptInit:13305)"...
Is this a new Custom address being created on the Sales Order?
Are you able to share the code you have so far?
Thanks,
Chris