This article will demonstrate how users could display information from the Item being discounted.
Users should create a custom transaction column (free-form text) for storing the internal id of the discount item.
Use the script snippet to update the values for each transaction :
var cTranId = nlapiGetRecordId();
var filters = new Array();
filters[0] = new nlobjSearchFilter('internalid', null, 'anyof', cTranId); //internal id of the transaction record
var columns = new Array();
columns[0] = new nlobjSearchColumn('item');
var b = new Array();
var ss = nlapiSearchRecord('transaction', null, filters, columns);
for (a = 0; a < ss.length; a++) {
var item1 = ss[a].getValue(columns[0]);
if (item1 == 115) { //115 was the internalid of a sample discount item
nlapiSetLineItemValue('item', 'custcol_applied', a, ss[a - 1].getText(columns[0]));
}
}
create an item saved search that will have the criteria of item == *Discount Item Name* and add the custom transaction column on the results tab.
Note : This is an alternative solution for Enhancement - 273627 - Discount Search > Add the ability to display information from the item that is being discounted.
No comments:
Post a Comment