Why SOQL Optimization is Needed ? SOQL is a tool that lets you access records in your Salesforce database. When you don’t write good SOQL queries you’re going to hit the governor limit of non selective query. There is a very common issue that most of us have came across when there are more than 100k records…
Category: SOQL & SOSL
How to use SOSL query to search in multiple Salesforce objects?
SOSL is the Salesforce Object Search Language. We can search words, phrases or text with wildcard characters in multiple standard and Custom objects in Salesfore. Unlike ‘SELECT’ command in SOQL, we will use ‘FIND’ command to search in SOSL query. SOSL statements evaluate to a list of lists of sObjects, where each list contains the search results…
How to use SOQL Query with Nested SOQL, Aggregate functions, ORDER BY, GROUP BY, HAVING, OFFSET and LIMIT?
We can use SOQL query in different ways. If you want to fetch any 10 Accounts, you can use the following SOQL query: Select Id, Name From Account LIMIT 10 We can also use joins in SOQL to fetch data among multiple related objects. For e.g. We want to get Contact Name from Account. we can use the following SOQL query: Right…
How to query data using SOQL and display on a Visualfroce page using PageBlockTable ?
We can query data using SOQL and display on a Visualforce page. Let’s display Account and related Opportunities by passing id of an account in the URL. We will query all Opportunities related to the Account using SOQL in Apex, and display data on Visualforce page using PageBlockTable. Create a Visualforce page using following code: Visualforce Page: Name: {!Account.Name}…