You need to sign in to do that
Don't have an account?

how to avoid Schema describe method which was used inside for loop ?
for ex: for(Sobject sobj : Database.Query(sobjQuery))
Is there any other way to represent this?
Is there any other way to represent this?
You can use Schema Describe calls outside for loops or within for loops to get metadata depending on your requirement.
For Ex.:
OR
Both of above scenarios will work.
Check out this post for dynamic apex: http://sfdcfacts.com/apex/dynamic-record-display-how-to-display-record-of-any-sobject-on-same-visualforce-page/
Let me know if this helps.
**Please mark this as best answer if this answers your query.**
Thanks,
Manish Choudhari
14x Certified Salesforce Architect
Certification link: http://certification.salesforce.com/certification-detail-print?conId=003G000002gRrrEIAS
My Blog: http://sfdcfacts.com/
Youtube Channel: https://www.youtube.com/SFDCFacts
LinkedIn: https://www.linkedin.com/in/manish-choudhary/
Trailhead: https://trailhead.salesforce.com/en/me/manish-choudhari
Twitter: https://mobile.twitter.com/manish_sfdc