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
ShirinShirin 

Trigger to write a validation rule on Taks

We have a task object where tasks are assigned by managers to other users. We do not want the users to edit the due date. This field is not accessible in formula, validation or workflow rules. Does anybody know how to manage this? Can we write an apex trigger for the same.

 

Thanks

MandyKoolMandyKool

Hi,

 

The simple way to achieve this is to create a different page layout for your users and make this field read only for that page layout.

 

Hope this will help you!

sham_1sham_1

Alternatively, you can also write a trigger, on Task,

The trigger should check the current user profile / role

If the user role / profile should not be changing the due date. The trigger should flag an error.