• jenny kim 19
  • NEWBIE
  • 0 Points
  • Member since 2023

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 0
    Questions
  • 1
    Replies
  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.

 
  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.