New from Spring '14 is the MilestoneTriggerTimeCalculator interface. (https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_interface_support_milestonetriggertimecalculator.htm)

We use this method to be able to dynamically configure the time a support rep has to close a Case. Now, using this method, when I do a bulk update of Cases (to set the correct entitlement), I get the "too many SOQL (101)" error.

Since my own code is bulkified, I have a pretty strong feeling that the problem is this new MilestoneTriggerTimeCalculator interface.

Also, if you look at how you need to implement it, you only get a caseId and milestoneTypeId and from there, you need to do any additional queries that you would need to retrieve your correct response time.

Has anyone else seen this issue? And if so, does anyone has a suggestion / fix for this?


During bulk updates, you can have custom setting which sets the value to turn off the logic to set the dynamic time and you can return the static time value from the interface method.

If it is not the bulk updates then you can use the logic to set dynamic time in minutes.

  • this is not a good solution – Santanu Boral Feb 23 '17 at 21:23

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.