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.

Rookie Asked on March 25, 2021 in SuiteScript.
Add Comment
1 Answer(s)

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.

Beginner Answered on March 25, 2021.

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);
}

on March 26, 2021.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.
  • This site made possible by our sponsors:   Tipalti   Celigo   Limebox   Become a Sponsor