Discussions
Join the NetSuite community to innovate, connect, and discover what’s next.
SuiteWorld brings thousands of innovators, builders, and leaders together to learn, connect, and shape what’s next. This October, explore how to build a stronger foundation for growth through inspiring keynotes, major product reveals, hands-on sessions, and unforgettable moments—all in one place for our biggest event of the year. Register now
search.lookup options
Hello everyone,
I am trying to retrieve conversion rate from Units Type but getting the following error:
Any idea what the issue could be?
Thanks :)
The script is as below:
function validateLine(scriptContext) {
var currentRecord = scriptContext.currentRecord;
var sublistName = scriptContext.sublistId;
var sublistFieldName = scriptContext.fieldId;
var sublistName = 'item';
var sublistFieldName = 'units';
if(sublistName === 'item' && sublistFieldName === 'units'){
var soUnits = currentRecord.getCurrentSublistValue({
sublistId: 'item',
fieldId: 'units',
});
var fieldLookUp = search.lookupFields({
type: search.Type.UNITS_TYPE,
id: soUnits,
columns: ['conversionrate']
});
var Con_Rate= fieldLookUp.conversionrate[0].value
var SoQuantity = currentRecord.getCurrentSublistValue({
sublistId: 'item',
fieldId: 'quantity',
});
var totalPacks = SoQuantity*soUnits
currentRecord.setCurrentSublistValue({
sublistId: 'item',
fieldId: 'custcol13',