Salesforce Apex code for - All fields API names in an object - Object All fields by apex code
String SobjectApiName = 'OrderItem';//Order';
Map<String, Schema.SObjectType> schemaMap = Schema.getGlobalDescribe();
Map<String, Schema.SObjectField> fieldMap = schemaMap.get(SobjectApiName).getDescribe().fields.getMap();
for(String fieldName : fieldMap.keyset())
{
system.debug('fieldName->>'+fieldName);// feild api names
}
Comments
Post a Comment