+ Start a Discussion

count of DML Queries in Triigger ?

How to know number of DML Queries write in Trgger ?


Subbu - Have a look at the Limits class methods to get access to governor limits usage. For DML statements you can use Limits.getDMLStatements() to verify the number of DML's executed to this point and the Limits.getLimitDMLStatements() to verify available DML statements limits.


These are the counts


System.debug('Final number of script statements used so far : ' + Limits.getDmlStatements());
System.debug('Final heap size: ' + Limits.getHeapSize());

System.debug('Total Number of SOQL Queries allowed in this apex code context: ' +  Limits.getLimitQueries());

System.debug('1.Number of Queries used in this apex code so far: ' + Limits.getQueries());


If this post is helpful please throw Kudos.If this post solves your problem kindly mark it as solution.