I am trying to copy all the line items in the item sublist in one sales order to another new sales order. I am getting all the line items and while setting the line items I have followed the order shown below:
- Price level
- Item
- Quantity
- Amount
- Tax Code
The issue is that all the values are set correctly but the amount and tax code fields are not set. Is this the correct order to set the line item fields? If not, what is the order that I should follow so that lines commit successfully?
var set=currentRecord.setCurrentSublistValue({
sublistId: 'item',
fieldId: 'item',
value:salesOrd_item[j]
});
alert('item is being set');
currentRecord.setCurrentSublistValue({
sublistId: 'item',
fieldId: 'quantity',
value:salesOrd_quantity[j]
});
currentRecord.setCurrentSublistValue({
sublistId: 'item',
fieldId: 'units',
value:salesOrd_units[j]
});
alert('units are being set');
currentRecord.setCurrentSublistValue({
sublistId: 'item',
fieldId: 'taxcode',
value:salesOrd_taxcode[j]
});
currentRecord.setCurrentSublistValue({
sublistId: 'item',
fieldId: 'price',
value:salesOrd_pricelevel[j]
});
currentRecord.setCurrentSublistValue({
sublistId: 'item',
fieldId: 'rate',
value:salesOrd_rate[j]
});
currentRecord.setCurrentSublistValue({
sublistId: 'item',
fieldId: 'amount',
value:salesOrd_amount,
});