RE: Any Suggestion regarding this will be appriciated.
I have to Create a custom column field in item list of a loan form , which i have created already, now on user event after submit function i want to update that custom column for each item line with the item’s internal id.
1) use after submit, load the record
2) get item line count
3) inside a looping get item id and set to the current line custom field.
4) final submit record.
Can you point out the error in my code:
function afterSubmit_update(type){
var internalID = nlapiGetRecordId();
var salesOrder = nlapiLoadRecord(‘salesorder’,internalID);
var soItemCount = salesOrder.getLineItemCount(‘item’);
for(var x = 1; x <= soItemCount; x++){
var soItem = nlapiGetLineItemValue(‘item’, ‘item’, x);
salesOrder.setLineItemValue(‘item’,’custcol_field1′,x,soItem);
}
var id = nlapiSubmitRecord(salesOrder);
}