function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
santoshsantosh 

How to get allowable picklist values using query for type field in campaigns table

Hi All;
          I have one combo box in my program from which user selects the campaign type.(Here Type is nothing but the Type field in campaigns table).after selecting the campaign type I am displaying all the campaigns of the selected Type.
 
            Now this type field is a picklist itself.I want to show all values of the Type picklist in the combo box but I am not able to find the table from which I can find out all allowable values for Type picklist.Remember that type picklist is updatable so I can not hardcode the values for combo box.
Can anyone tell me how to get all allowable picklist values for the Type field in campaigns table.
 
Thanx in advance
:smileyvery-happy:
 
Regards;
Rohit 
Gareth DaviesGareth Davies
Code:
           DescribeSObjectResult pObjectDescription
           Field pFld = pObjectDescription.fields[i]
           PicklistEntry[] vals = pFld.picklistValues;
                try
                {
                    PicklistValues = new string[vals.Length];
                    for (int i = 0; i < vals.Length; i++)
                    {
                       PicklistValues[i]= vals[i].label;
                    }
                }
                catch
                {
                     ///Handle Error 
                }

 
Hope that helps
Gareth.