screnshaw
05/05/2022, 8:32 PMcustbody_mhi_ad_charge_freight_once
is checked. Also when I comment it out, it works
if (freight.amt === 0) {
newRec.setValue({
fieldId: 'custbody_mhi_ad_freight_override',
value: true,
ignoreFieldChange: true
});
}
newRec.setValue({
fieldId: 'custbody_mhi_ad_freight_rate',
value: freight.amt,
ignoreFieldChange: true
});
// If it is a hard value and not a percent value, charge freight once
newRec.setValue({
fieldId: 'custbody_mhi_ad_charge_freight_once',
ignoreFieldChange: !freight.isPct,
value: true
});
battk
05/05/2022, 8:36 PMscrenshaw
05/05/2022, 8:36 PMfunction fieldChanged(ctx) {
const fields = ['shipmethod', 'entity', 'custbody_mhi_ad_order_type', 'custbody_mhi_ad_charge_freight_once'];
if (fields.includes(ctx.fieldId)) {
log.debug('ctx', {
record: ctx.currentRecord,
sublistId: ctx.sublistId,
fieldId: ctx.fieldId,
lineNum: ctx.lineNum,
columnNum: ctx.columnNum
});
// log.debug('fieldChanged', ctx.fieldId);
freightHelper.setFreight(ctx);
}
}
battk
05/05/2022, 8:38 PMscrenshaw
05/05/2022, 8:38 PM