I create a customized csv import suitelet. It reads date from selected csv file, create sales order with ('ismultishipto',"T"), and create custom address for each line item. I used for loop to check if it is same address. When it happens to be same address, I need to select shipaddress. It seens that custom shipaddress is not available to load. I don't want go back to edit shipaddress after salesorder is created. How can I select shipaddress to a custom shippingaddress by script?
Here is my code to create custom shippingaddress:
var subrecord = newSalesorder.createCurrentLineItemSubrecord('item ', 'shippingaddress');
subrecord.setFieldValue( 'label', itemArray[i][nameIndex]);
subrecord.setFieldValue( 'attention', itemArray[i][nameIndex]);
subrecord.setFieldValue( 'addressee', itemArray[i][companyIndex]);
subrecord.setFieldValue( 'addr1', itemArray[i][streetIndex]);
subrecord.setFieldValue( 'city', itemArray[i][cityIndex]);
subrecord.setFieldValue( 'zip', itemArray[i][zipIndex]);
subrecord.setFieldValue( 'state', itemArray[i][stateIndex]);
subrecord.setFieldValue( 'country', 'US');
subrecord.commit();