This topic contains 1 reply, has 0 voices, and was last updated by michoel 7 years, 4 months ago.

  • Author
    Posts
  • #21533

    sramanan@aerohive.com

    Hi,

    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.

  • #21534

    michoel

    Here'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');

You must be logged in to reply to this topic.