+ Start a Discussion

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.