Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for (Contact c:[select id, name, firstname, Individual.id, Individual.FirstName, phone from Contact where id =:theId]) {
- String typeName = 'Contact';
- String fsName = 'FieldSetname';
- Schema.SObjectType targetType = Schema.getGlobalDescribe().get(typeName);
- Schema.DescribeSObjectResult describe = targetType.getDescribe();
- Map<String, Schema.FieldSet> fsMap = describe.fieldSets.getMap();
- Schema.FieldSet fs = fsMap.get(fsName);
- List<Schema.FieldSetMember> fieldSet = fs.getFields();
- List<FieldSetMember> fset = new List<FieldSetMember>();
- for (Schema.FieldSetMember f: fieldSet) {
- String fieldName = f.getFieldPath();
- c.fieldName = 'something';
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement