You need to sign in to do that
Don't have an account?
Abraham kumar 4
CUMULATIVE_LIMIT_USAGE
im Getting CUMULATIVE_LIMIT_USAGE at line 3 of this code
Below attached debug log details
Thanks
Abraham
for(integer i = 0;i < eventIdsList.size(); i++){ count = 0; for(Guest_New__c guest : existingGuestList ){ if((guest.Event__c == eventIdsList[i]) && eventAndStatusValues.get(eventIdsList[i]).Contains(guest.Status__c)){ count ++; } }Please help to resolve this issue bit urgent.. Please let me know if more inputs required.
Below attached debug log details
16:27:12.347 (36347838249)|EXCEPTION_THROWN|[37]|System.LimitException: Apex CPU time limit exceeded 16:27:12.347 (36347939235)|FATAL_ERROR|System.LimitException: Apex CPU time limit exceeded Trigger.TotalResponses: line 37, column 1 16:27:12.348 (36348089236)|CUMULATIVE_LIMIT_USAGE 16:27:12.348 (36348089236)|LIMIT_USAGE_FOR_NS|(default)| Number of SOQL queries: 4 out of 100 Number of query rows: 26854 out of 50000 ******* CLOSE TO LIMIT Number of SOSL queries: 0 out of 20 Number of DML statements: 1 out of 150 Number of DML rows: 33 out of 10000 Maximum CPU time: 15012 out of 10000 ******* CLOSE TO LIMIT Maximum heap size: 0 out of 6000000 Number of callouts: 0 out of 100 Number of Email Invocations: 0 out of 10 Number of future calls: 1 out of 50 Number of queueable jobs added to the queue: 0 out of 50 Number of Mobile Apex push calls: 0 out of 10 16:27:12.348 (36348089236)|CUMULATIVE_LIMIT_USAGE_END 16:27:12.348 (36348207142)|CODE_UNIT_FINISHED|TotalResponses on Guest_New trigger event AfterUpdate for [a0sD0000008ju0T, a0sD0000008jule, a0sD0000008jusR, a0sD0000008jvdu, a0sD0000008jwE2, a0sD0000008jxLq, a0sD0000008jyIu, a0sD0000008jyST, a0sD0000008jzkY, a0sD0000008k0Wy, a0sD0000008k14w, a0sD0000008k1sD, a0sD0000008k20q, a0sD0000008k2GF, a0sD0000008k3kC, a0sD0000008k4FZ, a0sD0000008k4Xx, a0sD0000008k4Zy, a0sD0000008k4r8, a0sD0000008k8qb, a0sD0000008k9iE, a0sD0000008kAEG, a0sD0000008kB8n, a0sD0000008kBIj, a0sD0000008kBp0, a0sD0000008kCYr, a0sD0000008kCb8, a0sD0000008kD5g, a0sD000000ApmVI, a0sD000000EstXy, a0sD000000Fr8Nf, a0sD000000GiAxg, a0sD000000LXsEf] 16:27:12.358 (36358504114)|DML_END|[20] 16:27:12.361 (36361896680)|FATAL_ERROR|System.LimitException: Apex CPU time limit exceeded Trigger.TotalResponses: line 37, column 1 16:27:12.361 (36361931440)|FATAL_ERROR|System.LimitException: Apex CPU time limit exceeded Trigger.TotalResponses: line 37, column 1 16:27:12.362 (36362032885)|CUMULATIVE_LIMIT_USAGE 16:27:12.362 (36362032885)|LIMIT_USAGE_FOR_NS|(default)| Number of SOQL queries: 2 out of 100 Number of query rows: 34 out of 50000 Number of SOSL queries: 0 out of 20 Number of DML statements: 1 out of 150 Number of DML rows: 33 out of 10000 Maximum CPU time: 0 out of 10000 Maximum heap size: 0 out of 6000000 Number of callouts: 0 out of 100 Number of Email Invocations: 0 out of 10 Number of future calls: 1 out of 50 Number of queueable jobs added to the queue: 0 out of 50 Number of Mobile Apex push calls: 0 out of 10 16:27:12.362 (36362032885)|CUMULATIVE_LIMIT_USAGE_END 16:27:12.362 (36362143925)|CODE_UNIT_FINISHED|CopycontactAddressToguestAddress on Contact trigger event AfterUpdate for [0032000000CK502] 16:27:12.364 (36364104454)|EXECUTION_FINISHED
Thanks
Abraham
1.Cumulative resource usage is logged at the end of many code units, such as triggers, executeAnonymous, batch Apexmessage processing, @future methods, Apex test methods, Apex web service methods, and Apex lead convert.
2.Cumulative profiling information is logged once at the end of the transaction and contains information about the most expensive queries (used the most resources), DML invocations, and so on.
for reference >> https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_debugging_debug_log.htm
Many Thanksin advance
Abraham
Instead of line no 24 - 32 you can use the below code
Which works exactly as what you have done.
Hope this might help you.
Thanks
Also instead of line no 35 - 46 you can use the below code,
Using a for loop inside a for loop may be reason for CPU limit exceed.
You have to avoid using many for loops.
Hope this might solve your issue
Thanks
Thanks