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
SFDC 8SFDC 8 

How to create dynamic soql update query in Apex on Case Object

I want to build a dynamic query on Case Object with web email as filter .How can i acheive this .
Best Answer chosen by SFDC 8
PriyaPriya (Salesforce Developers) 
Hey Vineet,

Kindly refer this guide to build the dynamic Soql query (https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_dynamic_soql.htm).

Also refer these similar examples :-
1. https://salesforce.stackexchange.com/questions/348265/dynamically-created-query-in-apex-and-update-the-value
2. https://developer.salesforce.com/forums/?id=906F0000000kCx2IAE
 

Kindly mark it as the best answer if it works for you.

 

Thanks & Regards,

Priya Ranjan


 

All Answers

PriyaPriya (Salesforce Developers) 
Hey Vineet,

Kindly refer this guide to build the dynamic Soql query (https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_dynamic_soql.htm).

Also refer these similar examples :-
1. https://salesforce.stackexchange.com/questions/348265/dynamically-created-query-in-apex-and-update-the-value
2. https://developer.salesforce.com/forums/?id=906F0000000kCx2IAE
 

Kindly mark it as the best answer if it works for you.

 

Thanks & Regards,

Priya Ranjan


 
This was selected as the best answer
rimenz joerimenz joe
To create a dynamic SOQL query at runtime you will use the database query method provided. Below are two examples of building dynamic SOQL at runtime https://paystublogin.onl/