Difference between SOQL and SOSL
SOQL SOSL SOQL is used if we know in which object the data is present. SOSL is used if we don't know in which object the data is present. In ....
SOQL SOSL SOQL is used if we know in which object the data is present. SOSL is used if we don't know in which object the data is present. In ....
FOR REFERENCE is used to notify Salesforce when a record is referenced. The LastReferencedDate field is updated for any retrieved records. Sample Query: SELECT City__c, State__c, LastReferencedDate FROM Employee__c FOR ....
Alias Notation is allowed in Salesforce SOQL. In the following sample SOQL, I have used Con as alias for Contact object and Acct for the Account object. Sample SOQL: SELECT ....
CreatedDate: Created Date Time of the record. CreatedById: Id of the user who created the record. Sample SOQL: SELECT Id, CreatedDate, CreatedById, CreatedBy.Name FROM Account LIMIT 5
Generally in SOQL, null values are sorted first. In order to sort null values at last make use of NULLS LAST keyword. Sample SOQL: SELECT Id, Name, Industry FROM Account ....
SOQL: SELECT UserRole.Name, Profile.Name FROM User Output:
Address Field in Lead object is a Compound Field. 1. Street2. State3. PostalCode 4. Country SOQL: SELECT Street, State, PostalCode, Country FROM Lead
INCLUDES keyword is used as filter for multi-select picklist in Salesforce. Sample Query: SELECT Name, AccountNumber, Territories__c FROM Account Where Territories__c INCLUDES ('North','South','') here North, South and '' are values. ....
SOSL stands(Salesforce object search language) SOQL stands for(Salesforce object query language) Works on multiple objects at the same time. Need to write different SOQL for multiple objects. Cannot be used ....
In SOQL, the LIKE operator is supported for string fields only. So, we cannot use it against any other field data types. Syntax: String strSOQL = 'SELECT FieldAPIName FROM sObject ....