Set default of Task Status Field based on Specific User - Answers - Salesforce Trailblazer Community
Trailblazer Community
Ask Search:
Romeo GuerreroRomeo Guerrero 

Set default of Task Status Field based on Specific User

Our organization's task Status field is defaulted to "Closed" for our whole organization. 

However, 3 users within our team would like the default to be "Not Started" for them when they try to create a new task. Is it possible to write a validation rule in the Status field on activities to accomplish this?

Thanks!
Best Answer chosen by Bhavin (salesforce.com) 
Andreea DorofteiAndreea Doroftei

Hello Romeo, 

While Adnan is right and writing a trigger is also feasible, this can be achieved declaratively with a before save flow on the Task object, like below. 

User-added image

In the playground this is in the default Status value for the task is "Not Started" and I choose to have it as "In Progress" for my user. Since it's 3 users only, although not recommended, you can use their IDs. As a best practice hard coding IDs or Names isn't something I'd recommend. 

User-added image

All Answers

Adnan Muhammad AshfaqAdnan Muhammad Ashfaq
Hi Romeo,

You need to write a trigger for that on task, check the user with their names and then set the status field to "Not Started".

Thanks,
Andreea DorofteiAndreea Doroftei

Hello Romeo, 

While Adnan is right and writing a trigger is also feasible, this can be achieved declaratively with a before save flow on the Task object, like below. 

User-added image

In the playground this is in the default Status value for the task is "Not Started" and I choose to have it as "In Progress" for my user. Since it's 3 users only, although not recommended, you can use their IDs. As a best practice hard coding IDs or Names isn't something I'd recommend. 

User-added image

This was selected as the best answer