You need to sign in to do that
Don't have an account?
BobRoyAce
Querying for available Picklist values for a particular field for a particular object
Let's say that I want to grab a list of all of the acceptable picklist values that can be selected for a particular field of a particular object (e.g. Account.Type). What VB.NET code could I use to accomplish something like this? Ideally, what I'd like is a function like follows:
Public Function GetPicklistEntriesForObjectForField(ByVal sObjectName as string, ByVal sFieldName as string) as string()
End Function
How could I do this for standard objects (e.g. Account)? How about for custom objects (e.g. Owner__c)?
see the describeSObject call, it has all that information in its response.
I created a function that allows for passing in an Object Name and a Field Name. Then, it returns a list of strings containing the picklist values that are defined for the field, if there are any. Here it is for anyone who's interested:
--- CODE BEGNS ---
--- CODE ENDS ---