Following is the code where Salesforce is showing error: "Compile Error: Variable does not exist: Limits"

if(updatedContacts.size() + Limits.getDMLRows() > Limits.getLimitsDMLRows()) {
        // show error about DML rows limit

Limits is an inbuilt class. Can someone tell me why this is happening?

| improve this question | | | | |

The correct method is getLimitDMLRows() not getLimitsDMLRows() as you have in your code.

| improve this answer | | | | |
  • 1
    I had a double check on it but still missed it somehow. Thanks for pointing out! – ajinkyah Feb 16 '15 at 11:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.