Number of DML statements per transaction: 150 (as a whole including insert, update, delete and undelete)
Number of rows processed per DML statement: 10000
SOQL: Salesforce Object Query Language
SOQL Purpose: To fetch records from an object and related objects.
We can write query on one object while querying on those objects we can fetch the child object records or parent object records
Governor Limits for SOQL statements
SOQL queries per transaction: 100
SOQL query rows returned: 50000
SOSL: Salesforce Object Search Language
SOSL Purpose: We can search for a value in multiple objects (no need of any relationship).
Results of SOSL query can be stored in List<List
Governor Limits for SOSL statements:
SOSL queries per transaction: 20
SOSL query rows returned: 2000
Assume that you are inserting 100 records.
Insert / Update | Database.Insert |
---|---|
If any one of the record fail due to error then entire operation will fail. None of the records will be saved into the database, by using insert/update if we use try-catch then we can capture only one error which will cause to stop the operation. | If any one of the record fail due to error then it will perform partial operation (valid records will be inserted/updated) by using Database.insert(list, false)/ Database.update(list, false) |
We can capture all the errors by saving result in Database.saveResult[]. |
Queues will store in Group object. To query for MyQueue from the database using SOQL, we should use the following syntax –
Group grp = [select Id, Name from Group where Name = ‘MyQueue’ and Type = ‘Queue’ Limit 1];