Skip to content

Instantly share code, notes, and snippets.

@bruceyue
Created September 3, 2012 07:03
Show Gist options
  • Save bruceyue/3607477 to your computer and use it in GitHub Desktop.
Save bruceyue/3607477 to your computer and use it in GitHub Desktop.
picklist value
public List<SelectOption> WarehouseName
{
get
{
List<SelectOption> options = new List<SelectOption>();
Schema.Describefieldresult fieldResult = ProductLocation__c.Warehouse__c.getDescribe();
List<Schema.PickListEntry> pickListEntries = fieldResult.getPickListValues();
for(Schema.PickListEntry entry : pickListEntries)
{
options.add(new SelectOption(entry.getValue(), entry.getValue()));
}
return options;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment