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
LauraJMLauraJM 

Milestone PM Non-Admin Trigger Error

Milestone PM Trigger Error
When one of my users is using milestones and predecessor milestones, he can't change the deadline date of a milestone that impacts another milestone.  But I can.  What kind of permissions does he need to change this.  See error..


Error:Apex trigger Milestone1_Milestone_Trigger caused an unexpected exception, contact your administrator: Milestone1_Milestone_Trigger: execution of AfterUpdate caused by: System.DmlException: Update failed.
First exception on row 0 with id a1UC0000002lOZ8MAM; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, Milestone1_Milestone_Trigger: execution of AfterUpdate caused by: System.DmlException: Update failed. First exception on row 0 with id a1UC0000002lOZPMA2; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, Milestone1_Milestone_Trigger: execution of AfterUpdate caused by: System.DmlException: Update failed. First exception on row 0 with id a1UC0000002lOZUMA2; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, Milestone1_Milestone_Trigger: execution of AfterUpdate caused by: System.DmlException: Update failed. First exception on row 0 with id a1XC0000002YuWRMA0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, Milestone1_Task_Trigger: execution of AfterUpdate caused by: System.QueryException: Implementation restriction: EntitySubscription only allows security evaluation for non-admin users when LIMIT is specified and at most 1000 Class.Milestone1_Task_Trigger_Utility.handleTaskAfterTrigger: line 47, column 1 Trigger.Milestone1_Task_Trigger: line 12, column 1: [] Class.Milestone1_Milestone_Trigger_Utility.checkTaskDependencies: line 162, column 1 Trigger.Milestone1_Milestone_Trigger: line 28, column 1: [] Class.Milestone1_Milestone_Trigger_Utility.checkSuccessorDependencies: line 103, column 1 Trigger.Milestone1_Milestone_Trigger: line 24, column 1: [] Class.Milestone1_Milestone_Trigger_Utility.checkSuccessorDependencies: line 103, column 1 Trigger.Milestone1_Milestone_Trigger: line 24, column 1: []: Class.Milestone1_Milestone_Trigger_Utility.checkSuccessorDependencies: line 103, column 1
Andy BoettcherAndy Boettcher
Try reading this StackExchange post to see if this helps:  http://salesforce.stackexchange.com/questions/11425/implementation-restriction-entitysubscription-only-allows-security-evaluation-f
LauraJMLauraJM
Still not sure how to proceed with this one.  My background is primarily declartive not code.  I was just still hoping to use this package off the app exchange and then again was hoping that someone would know how to help me. 
Andy BoettcherAndy Boettcher
Hi Laura!

I'm thinking there may just be too many tasks in your org for the code to handle as-is.  There is a funky limit on the number of Task records that can be pulled back by a non-admin user - it would be a code fix, but it's adding "LIMIT 1000" to the end of whatever query is hitting the limit.