Salesforce Free Developer >

Chapter 5 - SOSL >

SOQL vs SOSL | Dynamic SOSL

SOQL vs SOSL | Dynamic SOSL

Dynamic SOSL

Similar to Dynamic SOQL we can create Dynamice SOSL.

Whenever a user is selecting a piece of information on a page and then he/she is submitting it to the Apex program. Then in that Apex program, we need to generate that SOSL query at one time. In this case, we will use Dynamic SOSL.

SOQL vs SOSL

SOQL SOSL
You know in which object the data you are searching for resides You are not sure in which object the data might be.
The data needs to be retrieved from single object or related objects. You want to retrieve multiple objects and fields, which might not be related to each other.
SOQL queries can be used in Classes and Triggers. They are only supported in Apex Classes and Anonymous blocks.
We can perform DML operations on query result. We can not perform dml operations.
It returns records. It returns fields.
You can count retrieved records. You cannot count retrieved records.

Download Study Material

Get access to exclusive study material for Salesforce Certification and ace your exams!

Our Salesforce Certification Courses

Hey there! Glad you made it through our Salesforce Developer Training for beginners. But wait! We've got some high-in-demand Salesforce courses for you to take your Salesforce skills to the next level, making you a desired professional in the Salesforce job market.

Post a Comment

Your email address will not be published. Required fields are marked *