new to SuiteScript and Javascript in general. Working on one of the trainings to disable a field if another is checked (or enable) and have the following function below. I am getting an error though stating an unexpected error occured in a script running on this page. JS_Exception ReferenceError context is not defined. I am using Eclipse IDE with the NetSuite plug in so am using the template.
function fieldChanged(Context) {
var customer = context.newRecord
var applyCoupon = customer.getValue('custentity_sdr_apply_coupon');
var couponCode = customer.getValue('custentity_sdr_coupon_code');
//if apply coupon is checked enable coupon code, if unchecked disable coupon code and erase its content
if (!applyCoupon) {couponCode.isDisabled = true;
} else {couponCode.isDisabled = false;
}
}