Another Salesforce blog!!!

Salesforce, Apex

Dynamic Apex

using string literals

Literal strings must be enclosed in single quotation marks. double quotation marks are reserved for enclosing attribute values, and must be escaped in strings. Use the “\” character to escape strings. Favorite

sObjectUtils class, utility


Check InstanceOf of String or ID


Use Set in dynamic SOQL IN-clause in method without Database.query()

LINK LINK2 Favorite

how to get a picklist all values in apex controller

Apex Dynamic PickList values Favorite

From the Object Api name retrieving the SObject



How to get FieldSet fields in Apex Dynamically (fieldset name is not static)

You can use result as follows –


Instantiating an SObject Dynamically at Run-time

So how would you create a Generic SObject at run-time?


How to get all the required fields of sObject dynamically

There is no direct property available in Apex dynamic API to represent the required field. However there is another way to know about it. If any field have below three properties then it is mandatory field. If it is Creatable If it is not nillable and If it does not have any default value


get all the fields of sObject using dynamic Apex


Previous Posts