+ Start a Discussion

AllowEmail field in Quote's Status picklist

Hi all,


Probably easy but I can't figure out ...


In my VF Page, I need to access the Quote allowEmail field embedded in the Status picklist (http://www.salesforce.com/us/developer/docs/api_meta/Content/meta_picklist.htm).


Does anybody know how to do that ?


The best I could find until now if the following code but it only returns me the value of the PickList ... and not this specific allowEmail field :


        List<SelectOption> options = new List<SelectOption>();
        Schema.DescribeFieldResult F = Quote.Status.getDescribe();
             List<Schema.PicklistEntry> Ple = F.getPicklistValues();
             for(Schema.PicklistEntry p : ple){
                options.add(new SelectOption(p.getlabel(),p.getlabel()));


Thank you very much.


Best Answer chosen by Admin (Salesforce Developers) 

That is part of the metadata API. The full metadata API is not available to VF pages directly. You will not be able to divine the value of this field using Apex Code. Instead, you would have to use some complex client-based solution (JavaScript, Silverlight, Flex, etc). This is due to limitations in the metadata API; it is asynchronous by nature, and there is no access to decompressing ZIP files natively in Apex Code, both of which would be required to complete this task in native platform capabilities. However, you could create a client-side retrieval version and inject this data in as it becomes available, but I would think that is probably more trouble than it would be worth.