Discussions
Narrative Insights is Temporarily Unavailable due to an Infrastructure Issue. Learn how This Impacts Your Account and What to Expect While the Feature is Disabled.
updating s.no only for items other than disount
Hi all,
I have an user event script of after submit in my sales order form that automatically updates a custom column field s.no by incrementing.
Its getting good.
But my issue is i just want it to increment only to those items other than discount items.
so for discount items it should get blank..
So, please help me with this.
Here is my code:
function afterSubmitAppend(type)
{
var newId = nlapiGetRecordId();
var newType = nlapiGetRecordType(); //salesorder
var loadproj = nlapiLoadRecord(newType, newId);
var projid = loadproj.getFieldValue('custbody6');
var itemCount = loadproj.getLineItemCount('item'); //2
for (var i = 1; i <= itemCount; i++)
{
loadproj.setLineItemValue('item', 'custcol23', i, projid);