I have 2 fields that I would like to check if their values are equal with "current_outstanding_balance"
If so, it adds text to the field "current_outstanding_balance_check"
. It's working when i add one var to loop. But i tried add more like, but it's not working.
if(overduer && overdue == fieldNameForResult)
This is my code:
function(){
var fieldNameForResult = thisPointer.entity.getValue('current_outstanding_balance');
var overduer = thisPointer.entity.getValue('additional_personnel_costs');
var overdue = thisPointer.entity.getValue('overdue');
if(overduer && overdue == fieldNameForResult){
jQ('[id="current_outstanding_balance_check"]').val('True' );
}else{
jQ('[id="current_outstanding_balance_check"]').val('False' );
}
} ```
Now I have no error, but it shows me "False" even though both fields are empty.
CodePudding user response:
You need to add the check for both values:
if(parseFloat(overduer) parseFloat(overdue) == parseFloat(fieldNameForResult)){