Activity Forums Salesforce® Discussions How to get all the required fields of sObject dynamically in Apex?

  • Anjali

    Member
    September 17, 2020 at 1:52 PM

    public class ControllerClassName{public List<String> strList { get;set; }public void autoRun(){Map<String, Schema.SObjectField> objectFields = Schema.getGlobalDescribe().get('Account').getDescribe().fields.getMap();strList = new List<String>(objectFields.keySet());}}

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos