@fractastical LimitsUtility


/ Published in: Other
Save to your folder(s)



Copy this code and paste it in your HTML
  1. public class LimitsUtility {
  2. // MIT License
  3. // Maintained by Joel Dietz, Titania, Inc. http://www.titaniainc.com
  4.  
  5. static final Integer PERCENT_PER_QUERY = 65;
  6.  
  7. public static Integer rowsAvailable()
  8. {
  9. Integer rowLimit = Math.round( ( Limits.getLimitQueryRows() - Limits.getQueryRows() ) * ( PERCENT_PER_QUERY / 100.00 ) );
  10. if (rowLimit < 15)
  11. rowLimit = 1;
  12.  
  13. return rowLimit;
  14. }
  15.  
  16. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.