Two ways to use SOQL IN clause

With binding set of Ids We can have a simple SOQL statement like this: Or direct from keySet of Map With binding list of sObjects Actually,There has another way to use IN clause like this: Enjoy it!

read more

Use subquery in SOQL

Salesforce allows us to use subquery in SOQL. The following soql is a sample, shows how to filter out Parent Records that don’t have a related child with subquery. And subquery also works in Related(Lookup) Objects, e.g. Be attention that the object name have to be Child Relationship Name when subquery SELECT as a field, […]

read more

Group by multiple fields in SOQL

In this post I’ll show you the useage of Group By in SOQL. *Amazingly,SOQL supports groupping with multiple fields. The data I have prepared the data by Saels__c sObject, whose Account__c field is reference to Account,User__c field is reference to User, and Amount__c field is a Currency field. Group By 1.Simple Group BY 1.Group by […]

read more