Here we have set the puchase order list for the selecting vendor.
//this is the list of vendors with their related purchase order
let poList = JSON.parse(currentRecord.getValue({
fieldId: ‘custpage_polist’
}));
let vendor = currentRecord.getValue({
fieldId: ‘custpage_vendornameupd’
});
let field = currentRecord.getField({
fieldId: ‘custpage_polisting’
});
let list = poList[vendor];
let check = (list != ‘undefined’)
if (list) {
for (let i = 0; i < list.length; i++) {
field.insertSelectOption({
text: list[i].docNo,
value: list[i].internalId
});
}
return true;
}
else {
alert(“There is no purchase order for this vendor.”);
return false;
}