Getting The Right Pricing for Vendors on Items When Multi-Currency Vendors Enabled
Getting the specific pricing for Vendors on item record can be done using the snippet below :
On Item Record, Create a script that will do the following :
var itemRec = nlapiGetRecordId();
var filters = new Array();
filters[0] = new nlobjSearchFilter('internalid', null, 'anyof', itemRec); //itemRec will be the internal id retrieved from nlapiGetRecordId()
filters[1] = new nlobjSearchFilter('vendorpricecurrency', null, 'anyOf', 1); //4th parameter should be the internalid of the preferred currency of the vendor.
var columns = new Array();
columns[0] = new nlobjSearchColumn('vendorcost'); //this would show the value of the Purchase Price for the selected Currency.
var ss = nlapiSearchRecord('inventoryitem', null, filters, columns);
var priceValue = ss[0].getValue('vendorcost'); //store the result to custom object
No comments:
Post a Comment