function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SainSain 

What is Dynamic Apex?

I am in the learning stages of Salesforce Apex. I have read the topic of Dynamic Apex but not able to understand the concept, Can someone explain it how to deal with it and in which scenarios it is best to use?

Thanks in advance!!
Pavan DavePavan Dave
Dynamic Apex provides ability for below areas:

1. Access sObject and field describe information -
Let say, you want to create or delete a field (any metadata realated changes), outside of salesforce org, you may achieve this by querying on sObject and fields.

2. Access Salesforce app information - 
Lets say, you want information for any salesforce app (Standard, custom), collection of tabs, namespace, you can get it.

3. Write dynamic SOQL queries -
Good to use for AppExchange applications.