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

  • Author
    Posts
  • #21840 Score: 0

    zcheng100
    • Contributions: 0
    • Level 1

    newSO.setFieldValue('ismultishipto',"T");

    for(var i=0;i<itemInternalIdList.length;i++){

    newSO.selectNewLineItem('item');

    newSO.setCurrentLineItemValue('item', 'item', itemInternalIdList[i]);

    newSO.setCurrentLineItemValue('item', 'quantity', itemQtyList[i]);

    newSO.setCurrentLineItemValue('item', 'location', '4');

    newSO.setCurrentLineItemValue('item', 'taxcode', '-7');

    newSO.setCurrentLineItemValue('item', 'description',itemRefList[i]);

    newSO.setCurrentLineItemValue('item', 'shipmethod', '50943');

    var subrecord = newSO.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]+" "+itemArray[i][aptIndex]);

    subrecord.setFieldValue('city', itemArray[i][cityIndex]);

    subrecord.setFieldValue('zip', itemArray[i][zipIndex]);

    subrecord.setFieldValue('state', itemArray[i][stateIndex]);

    subrecord.setFieldValue('country', 'US');

    subrecord.commit();

    }

    newSO.commitLineItem('item');

    nlapiSubmitRecord(newSO, true);

    Here is my code to create a multi shipping routes sales order. But with this code, each line item will be assigned with an address. No matter if it is same address. when i save the salesorder, each line item will have its own shipaddress. I used for loop to check same address. It wouldn't solve the problem. Custom address would not be loaded. I can only go back to that salesorder, and edit, manually select shipaddress, How can i do this with suitescrip: when line items have same shipping address. they will be assigned with the same custom shipaddress?
    This is a cached copy. Click here to see the original post.

  • #21841 Score: 0

    zcheng100
    • Contributions: 0
    • Level 1

    Any body help me with this problem please.

You must be logged in to reply to this topic.