Salesforce Asked by edukondalu on November 20, 2021
i had populate all the object names in the org by using "iteration"in lightning component then i got all object names shown below then my requirement is whenever i onclick any objectname i need to display all fields of that object
You can get the fields name from the Object name using describe call:
String SobjectApiName = 'Account';
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); // This will give you the api name of the field name.
}
Answered by Aakriti.G on November 20, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP