Activity Forums Salesforce® Discussions How to get fields API name using Schema class?

  • Kirandeep

    Member
    July 13, 2020 at 2:49 PM

    Get a list of API Names of all Fields for an Object.
    Schema.DescribeSObjectResult r =Object__c.sObjectType.getDescribe();
    List<String>apiNames = new list<String>();
    for(Schema.DescribeSObjectResult result : r){
    apiNames. add(); //this is where I am lost.
    }

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos