0

I need to create combobox with Field Set names. I know how to get fields for any Field Set, but how to get a list of all Field Set names.

Map<String, Schema.FieldSet> canMap = Schema.SObjectType.Candidate__c.fieldSets.getMap();

Maybe there are methods like getValue or getNames, or something like that?

0

1 Answer 1

1

canMap in your example code does contain the fieldset names. They're the keys of the map, so you can retrieve them by using the keySet() method from the Map class.

Set<String> fieldSetNames = canMap.keySet();

I'm not 100% certain if that gets you the (API) name, or the label of the fieldset. If you find that you need the other fieldset identifier, then the Fieldset class has methods to get what you need (this would involve a loop).

1

Not the answer you're looking for? Browse other questions tagged .