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

Popular posts from this blog

Multi currency in Salesforce - Revenue Cloud Advance - Revenue Lifecycle Management

How to get sessionid and salesforce org base url in salesforce

rollup summary with bulk record handling without hitting governer limits