Showing posts with label SOQL. Show all posts
Showing posts with label SOQL. Show all posts

What is SOQL FIELDS() Functions in Salesforce - SOQL Basic | Salesforce Funda

Salesforce has introduced SOQL Fields functions. This new function lets us query all the Salesforce fields of the object, Before you would have to add various fields api names to the select to get their values

You can include any of these in the field list:

  • FIELDS(ALL) — select all the fields of an object.
  • FIELDS(CUSTOM) — select all the custom fields of an object.
  • FIELDS(STANDARD) — select all the standard fields of an object

What is Polymorphic Relationships(POLYMORPHIC FIELDS) in SOQL Queries - SOQL Basic | Salesforce Funda

 A polymorphic relationship is a relationship between objects where a referenced object can be one of several different types. For example, the Who relationship field of a Task can be a Contact or a Lead.

You can use SOQL queries that reference polymorphic fields in Apex to get results that depend on the object type referenced by the polymorphic field. 


One approach is to filter your results using the Type qualifier. 

Advanced SOQL Statements - FOR VIEW, FOR REFERENCE, UPDATE VIEWSTAT, FOR UPDATE, ALL ROWS - SOQL Basic | Salesforce Funda


FOR VIEW :  This is used to fetch records from last day fetched records.

FOR REFERENCE : To update LastReferencedDate this is used.

SOQL Relationships - Parent to Child SOQL | Child to Parent SOQL for Standard and Custom Object - SOQL Basic | Salesforce Funda

SOQL allows you to query and retrieve data from Salesforce objects and their relationships. SOQL Relationships between objects are mainly used to query the records from one or more objects in a single SOQL statement in salesforce.com

These queries are used to fetch data either from the Parent object when the SOQL query is written on the child, or from the child object when the SOQL query is written on the parent

SOQL Group By or GROUP BY ROLLUP Clause - SOQL Basic | Salesforce Funda

You can use the GROUP BY option in a SOQL query to avoid iterating through individual query results. That is, you specify a group of records instead of processing many individual records.

GROUP BY clause is used in SOQL query to group set of records by the values specified in the field. We can perform aggregate functions using GROUP BY clause.

Both GROUP BY and GROUP BY ROLLUP Clause are similar to each other but IN SOQL GROUP BY ROLLUP Clause returns multiple levels of subtotal rows. 

When we using GROUP BY ROLLUP Clause in a statement we can add up to three fields in a comma-separated list.

What is an escape sequence ? - SOQL Basic | Salesforce Funda

 SOQL defines several escape sequences that are valid in queries so that you can include special characters in your queries. You can escape new lines, carriage returns, tabs, quotes, and more. The escape character for SOQL is the backslash (\) character.


SOQL Date Literals and Date Formats - SOQL basic | Salesforce funda

 When SOQL statements we should follow some date formats which are predefined in salesforce. You can specify date values or date literals in WHERE clauses to filter SOQL query results. Dates represent a specific day or time, while date literals represent a relative range of time, such as last month, this week, or next year.

SOQL Logical and Comparison Operators - SOQL Basics | Salesforce Funda

 Comparison operators in SOQL are used to compare a value with another value to return TRUE or FALSE.


What is SOQL ? Types of SOQL - SOQL Basics | Salesforce Funda

 SOQL term as Salesforce Object Query language, This is Salesforce Object Query Language designed to work with SFDC Database. 



SOQL(Salesforce Object Query Language) is used to query the records from the database based on the requirement.  It can search a record on a given criterion only in single sObject.

Filtering records :- Where, LIKE, IN, NOT IN, INCLUDES, EXCLUDES, Semi-Joins with IN and Anti-Joins with NOT IN, ORDER BY, GROUP BY, OFFSET in Salesforce SOQL - SOQL Basic | Salesforce Funda

 



Filtering records with various operators let's check all one by one Where, LIKE, IN, NOT IN, INCLUDES, EXCLUDES, Semi-Joins with IN and Anti-Joins with NOT IN, ORDER BY, GROUP BY, OFFSET