Skip to Content

TheBlogReaders.com

Salesforce.com, PHP, MySQL, Javascript, Ajax, Htacces

Enum Data Type in Salesforce

Be First!
by March 14, 2013 APEX, SALESFORCE

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.

(1964)

Previous
Next

Leave a Reply