function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
subbu123.pbt@gmail.comsubbu123.pbt@gmail.com 

count of DML Queries in Triigger ?

How to know number of DML Queries write in Trgger ?

vbsvbs

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.

souvik9086souvik9086

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.

Thanks