You need to sign in to do that
Don't have an account?

Field sets in apex
Hi,
On Account Object we have 4 field sets. In apex, i need to query all the fieldsets and get the value of each field and dispay on VF page.
In the below syntax, we have to mention the FS name which i dont want.
List<Schema.FieldSetMember> fields = Schema.SObjectType.Account.fieldSets.getMap().get('field_set_name').getFields();
Regards,
Desai
On Account Object we have 4 field sets. In apex, i need to query all the fieldsets and get the value of each field and dispay on VF page.
In the below syntax, we have to mention the FS name which i dont want.
List<Schema.FieldSetMember> fields = Schema.SObjectType.Account.fieldSets.getMap().get('field_set_name').getFields();
Regards,
Desai
Map<String, Schema.FieldSet> FsMap = Schema.SObjectType.Account.fieldSets.getMap();
But now , need to query on Account with the fields under the field sets where order id = 'xya' and type ='abc'
Check this link, It Might help you
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_methods_system_fieldsets_describe.htm