This topic contains 1 reply, has 0 voices, and was last updated by michoel 7 years, 4 months ago.
-
AuthorPosts
-
July 6, 2017 at 4:59 pm #21533
sramanan@aerohive.comHi,
I am creating Sales Order through Suitescript 1.0 and trying to set Shipping Address on an Sales Order through the script when order is getting created. For US Addresses, all the fields are getting assigned correctly. For Canada, only Country, Zip Code & Ship Phone is getting set. All others going blank. Below is the Suitescript I'm using to assign the address.
Any help on this is appreciated.
record.setFieldText('shipaddresslist', 'New');
record.setFieldValue('shipattention', searchresult.getValue( 'custrecord_ah_inb_ship_to_attn' ));
record.setFieldValue('shipaddressee', searchresult.getValue( 'custrecord_ah_inb_ship_to_addressee' ));
record.setFieldValue('shipaddr1', searchresult.getValue( 'custrecord_ah_inb_ship_to_addr1' ));
record.setFieldValue('shipaddr2', searchresult.getValue( 'custrecord_ah_inb_ship_to_addr2' ));
record.setFieldValue('shipcity', searchresult.getValue( 'custrecord_ah_inb_ship_to_city' ));
record.setFieldValue('shipstate', searchresult.getValue( 'custrecord_ah_inb_ship_to_state' ));
record.setFieldValue('shipcountry', searchresult.getValue( 'custrecord_ah_inb_ship_to_country' ));
record.setFieldValue('shipzip', searchresult.getValue( 'custrecord_ah_inb_ship_to_zip' ));
record.setFieldValue('shipphone', searchresult.getValue( 'custrecord_ah_inb_ship_to_phone' ));
Thanks,
This is a cached copy. Click here to see the original post. -
July 6, 2017 at 7:47 pm #21534
michoelHere's what we use – works for Australia ๐
Code:
// https://usergroup.netsuite.com/users/forum/platform-areas/customization/suitescript-custom-code/342881-transaction-custom-address-script-doesn-t-work
record.setFieldValue('shipaddresslist',-2);
var shipaddr = record.createSubrecord('shippingaddress');
shipaddr.setFieldValue('country', 'AU');
shipaddr.setFieldValue('isresidential', 'F');
shipaddr.setFieldValue('attention', '');
shipaddr.setFieldValue('addressee', '');
shipaddr.setFieldValue('addr1', address);
shipaddr.setFieldValue('addr2', '');
shipaddr.setFieldValue('city', city);
shipaddr.setFieldValue('state', state);
shipaddr.setFieldValue('zip', zip);
shipaddr.commit();
record.setFieldValue('shipaddress', address + 'n' + city + ' ' + state + ' ' + zip + 'nAustralia'); -
AuthorPosts
You must be logged in to reply to this topic.