Back
Is there a way to fetch a list of all fields in a table in Salesforce?
DESCRIBE myTable
doesn't work, and
SELECT * FROM myTable
doesn't work.
select * from table_name is used in SQL. But, SOQL doesn’t support anything like that. You’ll need to use the following code for the same:
SObjectType accountType=Schema.getGlobalDescribe().get(‘Account’);Map<String,Schema.SObjectField>mfields=accountType.getDescribe().fields.getMap();
SObjectType accountType=Schema.getGlobalDescribe().get(‘Account’);
Map<String,Schema.SObjectField>mfields=accountType.getDescribe().fields.getMap();
To learn in-depth about Workflow in Salesforce, sign up for an industry based Salesforce developer certification.
30.9k questions
32.9k answers
500 comments
665 users