You need to sign in to do that
Don't have an account?
hramani
Adding all the fields (api names) into a list
I have a code where there is a map containing and its fields.
I want to extract all the fields from those 2 objects (Contact and Application__c) and store them in a list. I have just declared a Map and added values to it.
How do I extract all the fields of those two fields and store them in a List. Please help
Map<String,List<String>> objectMap = new Map<String,List<String>>();
List<String> newList = new List<String>{'Contact.Name','Contact.Id'};
List<String> newList1 = new List<String>{'Application__c.Name','Application__c.Id'};
objectMap.put('Contact',newList);
objectMap.put('Application__c',newList1);
I want to extract all the fields from those 2 objects (Contact and Application__c) and store them in a list. I have just declared a Map and added values to it.
How do I extract all the fields of those two fields and store them in a List. Please help
Map<String,List<String>> objectMap = new Map<String,List<String>>();
List<String> newList = new List<String>{'Contact.Name','Contact.Id'};
List<String> newList1 = new List<String>{'Application__c.Name','Application__c.Id'};
objectMap.put('Contact',newList);
objectMap.put('Application__c',newList1);
Lokesh Kumar
Use this code snippet to get the fields of the object