Another Salesforce blog!!!

Salesforce, Apex

enum in APEX


global with sharing class My_Controller {
  public Case currCase {get; set; }
  public enum StatusValue {RED, YELLOW, GREEN}

  public StatusValues getColorStatus() {
    return StatusValue.RED;  //demo code - just return red
  }
}
<apex:image url='stopsign.png' rendered="{!colorStatus == StatusValue.RED}" />

Leave a Reply

Your email address will not be published.

*