Method to get the Field API Names - Schema.SObjectTypeFields.

PHOTO EMBED

Wed Jul 27 2022 06:29:03 GMT+0000 (Coordinated Universal Time)

Saved by @pradeepkumar28 #javascript

Schema.DescribeSObjectResult r = Account.sObjectType.getDescribe();
List<String>apiNames =  new list<String>();
for(string apiName : r.fields.getMap().keySet()){
   apiNames.add(apiName);
}
System.debug(apiNames);
content_copyCOPY