it is the code to get value of fields individually from an object which is returned by the search.lookupField()
const curRec = scriptContext.currentRecord;
let cusName = curRec.getText({
fieldId: ‘entity’
});
let cusId = curRec.getValue({
fieldId: ‘entity’
});
let cusSearch = search.lookupFields({
type : search.Type.CUSTOMER,
id : cusId,
columns: [‘overduebalance’,’companyname’]
});
let balanceDue = cusSearch.overduebalance;
let cusName = cusSearch.companyname;
log.debug(‘Customer,overdue Balance’, balanceDue + ‘ ‘ + cusName);