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
MktdevMktdev 

Querying fieldset

Hi,

How can we query fieldset in a controller.

Regards,
Mktg
bob_buzzardbob_buzzard

I don't think you can access fieldsets via Apex at the moment.  If you look at this blog post:

 

http://blog.sforce.com/sforce/2011/02/using-field-sets-in-spring-11.html

 

In a comment near the bottom the author states:

 

--- 

 

Great question. There is unfortunately no way to access Field Sets metadata in Apex currently. Ideally this should be supported via a Apex describe call (something like Account.sObjectType.getDescribe().fieldSets().fieldsInFieldSet();). However, this is not currently supported. Therefore you do have to make sure that the SOQL query includes all the fields that could possibly be included in the Field Set.

 

---