mg2017
07/27/2021, 8:05 PMif (context.type === context.UserEventType.EDIT || context.type === context.UserEventType.CREATE) {
//Run Function
}
if (context.type !== context.UserEventType.VIEW) {
//Do not run function in view mode
}
This is inside the beforeLoad. The function in the second if statement should not run in edit mode - but it does, any ideas?Sandii
07/27/2021, 8:09 PMSandii
07/27/2021, 8:10 PMCD
07/27/2021, 8:12 PMCD
07/27/2021, 8:24 PMmg2017
07/27/2021, 8:37 PMmg2017
07/27/2021, 8:39 PMif (context.type === context.UserEventType.EDIT || context.type === context.UserEventType.CREATE) {
const address_list = context.form.addField({
id: 'custpage_iss_address',
type: serverWidget.FieldType.SELECT,
label: 'Customer Address'
});
}
if (context.type !== context.UserEventType.EDIT) {
const current_record = context.newRecord;
const customer_id = current_record.getValue({
fieldId: 'company'
});
const address_set = PopulateAddress(current_record, customer_id);
}
still entering second ifmg2017
07/27/2021, 8:46 PM