You need to sign in to do that
Don't have an account?
Angela Skenderi 2
I have 2 different errors regarding my Decimal fields. What would be a good solution?
private Decimal getCarAllowances() {
Decimal value = 0;
for (Pay_Element__c payElement : payElements) {
if (payElement.Is_Addition__c && payElement.Car_Allowance__c) {
value += payElement.Value__c;
}
}
return value;
}
Logical operator can only be applied to Boolean is the error I receive for this method.
private Decimal getCarAllowances() {
Decimal value = 0;
for (Pay_Element__c payElement : payElements) {
if (payElement.Is_Addition__c == payElement.Car_Allowance__c) {
value += payElement.Value__c;
}
}
return value;
}
Comparison arguments must be compatible types: Boolean, Decimal is the error I receive for this one.
Decimal value = 0;
for (Pay_Element__c payElement : payElements) {
if (payElement.Is_Addition__c && payElement.Car_Allowance__c) {
value += payElement.Value__c;
}
}
return value;
}
Logical operator can only be applied to Boolean is the error I receive for this method.
private Decimal getCarAllowances() {
Decimal value = 0;
for (Pay_Element__c payElement : payElements) {
if (payElement.Is_Addition__c == payElement.Car_Allowance__c) {
value += payElement.Value__c;
}
}
return value;
}
Comparison arguments must be compatible types: Boolean, Decimal is the error I receive for this one.
Try below code
Please mark it as best answer if it helps
Thanks
All Answers
Try below code
Please mark it as best answer if it helps
Thanks