Hello - I have 2 data tables that are conditional. One data table is required if the ticket is "aging". The other data table is required if the ticket is "lockbox". Could I get some help with the code? I am getting an unmatched { error on the first row (fd.rendered (function() {
and an expected identifier error at the bottom of the function.
fd.rendered(function() {
fd.field('InquiryType').$on('change',function(value){
// Validate required column fields are not empty
if(value == "LockBox") {
fd.control('LockBoxClaimInquiries').addValidator({
name: 'LockBoxClaimInquiries validator',
error: "Fill out the required column fields.",
validate: function(value){
for(var i = 0; i < value.length; i++){
if(!value[i].LBChartID || !value[i].LBPatientName || !value[i].LBDOS || !value[i].LBCheckNo || !value[i].LBPaidAmount || !value[i].LBCheckAmount || !value[i].LBCashedClearedDate || !value[i].LBMailedTo || !value[i].LBReasonInquiry){
return false;
}
}
return true;
}});
if(value == "Aging") {
fd.control('AgingClaimInquiries').addValidator({
name: 'AgingClaimInquiries2 validator',
error: "Fill out the required column fields.",
validate: function(value){
for(var i = 0; i < value.length; i++){
if(!value[i].AgingChartID || !value[i].AgingPatientName || !value[i].AgingDOS || !value[i].AgingProvider || !value[i].AgingClaimAmount || !value[i].AgingIssueTrakYN || !value[i].AgingReasonInquiry){
return false;
}
}
return true;
}});
}}}
});