Enum Data Type in Salesforce
• Enum (or enumerated list) is an abstract that stores one value of a finite set of specified identifiers.
• To define an Enum, use enum keyword in the variable declaration and then define the list of values.
• By creating this Enum, you have created a new data type called Season that can be used as any other data type.

Enum Data Type Methods
Although Enum values cannot have user-defined methods added to them, all Enum values have some implicit methods similar to Java.
• Ordinal() returns the position of the item in the list(from 0)
• Name() returns name of the Enum item as String.
• Values() is a static method that returns the list of values.

Written by 

2x Salesforce MVP | Platform Champion | 18x Salesforce Certified | MuleSoft Certified | 8x Trailhead Ranger | TechForce Services | Sydney | Australia

Leave a Reply

Your email address will not be published. Required fields are marked *