String fieldSetName = 'Account_FieldSet';
String ObjectName = 'Account';
I wanted get list of all fields from this fieldset.
I know if fieldset name is hardcoded in the apex then following syntax works –
SObjectType.Account.FieldSets.Account_FieldSet.getFields();
But here main issue is Object name and fieldset name will come at runtime.
Best Answer
How to get FieldSet fields in Apex Dynamically (fieldset name is not static)
Here is the method I came up with lots of trial and errors -
You can use result as follows -