How to perform field update before a Validation Rule? (without code)
Clash Royale CLAN TAG#URR8PPP
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;
up vote
1
down vote
favorite
I have a requirement in which I have to check a Cases Owner before I can insert a task. It should only allow task creation on Cases with Owners which are not queues.
At first, we tried accessing the case Owner field on a validation rule. That doesn't seem to be possible due to they way the task-case relationshop works.
Then, we tried with a field update (Process Builder, workflow rule) to update a "Case Owner Is Queue?" field on the task as it is created.
With that field updated, creating the validation rule would be simple.
The obvious problem here is that validation rules run before any process or Workflow rule.
Is there a solution to this problem? I want to avoid code unless there is no other way around it.
workflow process-builder case validation-rule tasks
add a comment |Â
up vote
1
down vote
favorite
I have a requirement in which I have to check a Cases Owner before I can insert a task. It should only allow task creation on Cases with Owners which are not queues.
At first, we tried accessing the case Owner field on a validation rule. That doesn't seem to be possible due to they way the task-case relationshop works.
Then, we tried with a field update (Process Builder, workflow rule) to update a "Case Owner Is Queue?" field on the task as it is created.
With that field updated, creating the validation rule would be simple.
The obvious problem here is that validation rules run before any process or Workflow rule.
Is there a solution to this problem? I want to avoid code unless there is no other way around it.
workflow process-builder case validation-rule tasks
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I have a requirement in which I have to check a Cases Owner before I can insert a task. It should only allow task creation on Cases with Owners which are not queues.
At first, we tried accessing the case Owner field on a validation rule. That doesn't seem to be possible due to they way the task-case relationshop works.
Then, we tried with a field update (Process Builder, workflow rule) to update a "Case Owner Is Queue?" field on the task as it is created.
With that field updated, creating the validation rule would be simple.
The obvious problem here is that validation rules run before any process or Workflow rule.
Is there a solution to this problem? I want to avoid code unless there is no other way around it.
workflow process-builder case validation-rule tasks
I have a requirement in which I have to check a Cases Owner before I can insert a task. It should only allow task creation on Cases with Owners which are not queues.
At first, we tried accessing the case Owner field on a validation rule. That doesn't seem to be possible due to they way the task-case relationshop works.
Then, we tried with a field update (Process Builder, workflow rule) to update a "Case Owner Is Queue?" field on the task as it is created.
With that field updated, creating the validation rule would be simple.
The obvious problem here is that validation rules run before any process or Workflow rule.
Is there a solution to this problem? I want to avoid code unless there is no other way around it.
workflow process-builder case validation-rule tasks
workflow process-builder case validation-rule tasks
asked 1 hour ago
Henrique
152
152
add a comment |Â
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
3
down vote
Combining a declarative field update with a validation rule is a creative idea. Some people would go right for code!
You're right about it being impossible though, since custom validation rules run before workflow rules or process builder flows could update the record. You will have to use a trigger for this.
You can run the case owner check, and then use the addError method to stop the record(s) from being saved to the database.
For reference, this is the order of execution for creating a record:
- Runs system validation rules and validation rules for multiline
objects (opportunity line-items, quote line-items, ...) - Executes all before triggers Custom Validation rules
- Executes all after triggers
- Executes assignment rules
- Executes auto-response rules
- Executes workflow rules
and so on.
Complete Order of Execution reference here.
Standard validation rules are run again after a record is updated by a workflow or process builder, but custom validation rules aren't, which leaves you stuck with a trigger.
New contributor
Dean M. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |Â
up vote
0
down vote
Validation rules run again after Process Builders. However the error messages you get when a PB violates a validation rule might be uglier.
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
Combining a declarative field update with a validation rule is a creative idea. Some people would go right for code!
You're right about it being impossible though, since custom validation rules run before workflow rules or process builder flows could update the record. You will have to use a trigger for this.
You can run the case owner check, and then use the addError method to stop the record(s) from being saved to the database.
For reference, this is the order of execution for creating a record:
- Runs system validation rules and validation rules for multiline
objects (opportunity line-items, quote line-items, ...) - Executes all before triggers Custom Validation rules
- Executes all after triggers
- Executes assignment rules
- Executes auto-response rules
- Executes workflow rules
and so on.
Complete Order of Execution reference here.
Standard validation rules are run again after a record is updated by a workflow or process builder, but custom validation rules aren't, which leaves you stuck with a trigger.
New contributor
Dean M. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |Â
up vote
3
down vote
Combining a declarative field update with a validation rule is a creative idea. Some people would go right for code!
You're right about it being impossible though, since custom validation rules run before workflow rules or process builder flows could update the record. You will have to use a trigger for this.
You can run the case owner check, and then use the addError method to stop the record(s) from being saved to the database.
For reference, this is the order of execution for creating a record:
- Runs system validation rules and validation rules for multiline
objects (opportunity line-items, quote line-items, ...) - Executes all before triggers Custom Validation rules
- Executes all after triggers
- Executes assignment rules
- Executes auto-response rules
- Executes workflow rules
and so on.
Complete Order of Execution reference here.
Standard validation rules are run again after a record is updated by a workflow or process builder, but custom validation rules aren't, which leaves you stuck with a trigger.
New contributor
Dean M. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |Â
up vote
3
down vote
up vote
3
down vote
Combining a declarative field update with a validation rule is a creative idea. Some people would go right for code!
You're right about it being impossible though, since custom validation rules run before workflow rules or process builder flows could update the record. You will have to use a trigger for this.
You can run the case owner check, and then use the addError method to stop the record(s) from being saved to the database.
For reference, this is the order of execution for creating a record:
- Runs system validation rules and validation rules for multiline
objects (opportunity line-items, quote line-items, ...) - Executes all before triggers Custom Validation rules
- Executes all after triggers
- Executes assignment rules
- Executes auto-response rules
- Executes workflow rules
and so on.
Complete Order of Execution reference here.
Standard validation rules are run again after a record is updated by a workflow or process builder, but custom validation rules aren't, which leaves you stuck with a trigger.
New contributor
Dean M. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Combining a declarative field update with a validation rule is a creative idea. Some people would go right for code!
You're right about it being impossible though, since custom validation rules run before workflow rules or process builder flows could update the record. You will have to use a trigger for this.
You can run the case owner check, and then use the addError method to stop the record(s) from being saved to the database.
For reference, this is the order of execution for creating a record:
- Runs system validation rules and validation rules for multiline
objects (opportunity line-items, quote line-items, ...) - Executes all before triggers Custom Validation rules
- Executes all after triggers
- Executes assignment rules
- Executes auto-response rules
- Executes workflow rules
and so on.
Complete Order of Execution reference here.
Standard validation rules are run again after a record is updated by a workflow or process builder, but custom validation rules aren't, which leaves you stuck with a trigger.
New contributor
Dean M. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
edited 1 hour ago
New contributor
Dean M. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
answered 1 hour ago


Dean M.
413
413
New contributor
Dean M. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Dean M. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Dean M. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |Â
add a comment |Â
up vote
0
down vote
Validation rules run again after Process Builders. However the error messages you get when a PB violates a validation rule might be uglier.
add a comment |Â
up vote
0
down vote
Validation rules run again after Process Builders. However the error messages you get when a PB violates a validation rule might be uglier.
add a comment |Â
up vote
0
down vote
up vote
0
down vote
Validation rules run again after Process Builders. However the error messages you get when a PB violates a validation rule might be uglier.
Validation rules run again after Process Builders. However the error messages you get when a PB violates a validation rule might be uglier.
answered 1 hour ago
Charles T
5,5701618
5,5701618
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsalesforce.stackexchange.com%2fquestions%2f235764%2fhow-to-perform-field-update-before-a-validation-rule-without-code%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password