shree sashti
06/01/2021, 6:35 AMmichoel
06/01/2021, 6:43 AMshree sashti
06/01/2021, 6:46 AMmichoel
06/01/2021, 6:47 AMshree sashti
06/01/2021, 7:24 AMshree sashti
06/01/2021, 7:25 AMfunction fieldChanged(context) {
var rec=context.currentRecord;
if(context.sublistId == 'custpage_sublist' && context.fieldId=='custpage_productgroup') {
var location = rec.getCurrentSublistValue('custpage_sublist','custpage_productgroup');
alert(location);
if(location == '') return;
var vendorSearch = search.create({
type: 'employee',
filters: [['location','is',location]],
columns: ['entityid']
});
var vendorSearchResults = vendorSearch.run().getRange({ start: 0, end: 1000 });
var vendfield = rec.getSublistField({
sublistId:'custpage_sublist',
fieldId:'custapage_item',
line:0
});
vendfield.removeSelectOption({value : null});
if(vendorSearchResults.length != 0) {
for(var i in vendorSearchResults) {
vendfield.insertSelectOption({
value : vendorSearchResults[i].id,
text : vendorSearchResults[i].getValue('entityid')
});
}
}
}
}
return { fieldChanged : fieldChanged };shree sashti
06/01/2021, 7:26 AMYatin Karia
06/01/2021, 7:44 AMYatin Karia
06/01/2021, 7:44 AMYatin Karia
06/01/2021, 7:45 AMshree sashti
06/01/2021, 7:50 AMshree sashti
06/01/2021, 7:51 AMshree sashti
06/01/2021, 8:12 AMvar vendfield=rec.getField('custpage_vendor');
shree sashti
06/01/2021, 8:13 AMvar vendfield = rec.getSublistField({
sublistId:'custpage_sublist',
fieldId:'custapage_item',
line:0
});
Yatin Karia
06/01/2021, 8:23 AMYatin Karia
06/01/2021, 8:24 AMYatin Karia
06/01/2021, 8:24 AM