Morning all! I am creating Sales Orders for both ...
# suitescript
a
Morning all! I am creating Sales Orders for both US and Canada addresses. When sending over the same format, the Canada Addresses are dropping the Name , Street Address & City. Does anybody have any experience with this? Is there another value I need to pass in for Canada addresses? Or perhaps a different format? TIA!
c
Check the Canada address form (if you have one, it may default to the Standard one if it doesn't have one). Address forms are country specific. Customization->Forms->Address forms
b
Share the code
a
I checked the forms, and there is the Default, as well as 1 for US & Canada. Code Below: theRecord.setValue( { fieldId: 'shipaddresslist', value: null } ); var shipaddrSubrecord = theRecord.getSubrecord( { fieldId: 'shippingaddress' } ); shipaddrSubrecord.setValue( { fieldId: 'addressee', value: request['shippingaddress']['addr1'] }) ; shipaddrSubrecord.setValue( { fieldId: 'addr1', value: request['shippingaddress']['addr2'] }) ; shipaddrSubrecord.setValue( { fieldId: 'addr2', value: request['shippingaddress']['addr3'] }) ; shipaddrSubrecord.setValue( { fieldId: 'addrPhone', value: request['shippingaddress']['addrPhone'] }) ; shipaddrSubrecord.setValue( { fieldId: 'city', value: request['shippingaddress']['city'] }) ; shipaddrSubrecord.setValue( { fieldId: 'country', value: request['shippingaddress']['country'] }) ; shipaddrSubrecord.setValue( { fieldId: 'state', value: request['shippingaddress']['state'] }) ; shipaddrSubrecord.setValue( { fieldId: 'zip', value: request['shippingaddress']['zip'] }) ;
a
I'll take a look. I did review the forms and there is only 1 Custom Form, that is noted to be for US & Canada.
Fixed: Looked in the form that 'Country' was the first field in the Address Field List. Moved it to the top of the code setValues, that seems to have done the trick.