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

Querying fieldset


How can we query fieldset in a controller.


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


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.