netsuite - Can a transaction column formula field update after line item is added? Or only after record save -
i wanted create "total line" field on expense report expense line adds in amount taxes subtotal "amount" give total specific expense. problem though, after add line, blank. works after save record, not helpful staff entering expenses. limitation of netsuite? have put in script somehow refreshes record after line added? i'm not familiar scripting.
the formula {amount} + ({amount} * {taxrate1}) + ({amount} * {taxrate2})
the field id custcol_total_line
thanks
below field changed function use. make client script using below function. fire if amount on line changed.
/** * recordtype (internal id) corresponds "applied to" record in script deployment. * @appliedtorecord recordtype * * @param {string} type sublist internal id * @param {string} name field internal id * @param {number} linenum optional line item number, starts 1 * @returns {void} */ function clientfieldchanged(type, name, linenum){ if(type == 'item' && name == 'amount'){ var amount = nlapigetlineitemvalue('item','amount', linenum); var taxrate1 = nlapigetlineitemvalue('item','taxrate1', linenum); var taxrate2 = nlapigetlineitemvalue('item','taxrate2', linenum); var totallineamt = amount + (amount*taxrate1) + (amount*taxrate2); nlapisetlineitemvalue('item', 'custcol_total_line', linenum, totallineamt); } }
Comments
Post a Comment