Another Salesforce blog!!!

Salesforce, Apex

DML Limits

-DML governing limits:

  • You can have only 150 DML statements with in a transaction;
  • If you have more than 150 DML statements you will get an error “Too many DML statement : 151
  • To rectify this type of erros by using bulkify operations which is put similar operation on object in the list and invoke the DML on the List.

    System.debug('Before DmlStatements : ' + Limits.getLimitDmlStatements());
    System.debug('Before DmlRows : ' + Limits.getDmlRows());
    //DML queries...
    System.debug('After DmlStatements : ' + Limits.getLimitDmlStatements());
    System.debug('After DmlRows : ' + Limits.getDmlRows());

    -SOQL governing limits:

  • You can have only 100 SOQL queries within a transaction.
  • -DML records should not be more than 10,000

    Source Link

    Leave a Reply

    Your email address will not be published. Required fields are marked *