function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
MarcopppMarcoppp 

Apex if else statment

Hi 

 

Could somebody tell me how to make this if else statment working correctly?? Namely I would like to have 3 more statments like the one below as based on validation I want to display different messages  for if and for else. How to place 2 more if else statment ??? 

if (aText == 'A' ) {
    this.success = response__c;
    this.validationMessage = null;

        } else { 
                   this.validationMessage= validationMessages.NoValid__c;
                   this.success = null;

 

}

 

Thanks in advance

Vinita_SFDCVinita_SFDC

Hello,

 

You can use Esle If, ex:

 

if (place == 1) {
medal_color = 'gold';
} else if (place == 2) {
medal_color = 'silver';
} else if (place == 3) {
medal_color = 'bronze';
} else {
medal_color = null;
}