You need to sign in to do that
Don't have an account?

validation rule on (WhatId) send an email task
Hi Guys,
I have a requirement, When we select otherthan a Case on RelatedTo field it should throw error on the same page i.e Send an Email Task page.
The rule is not firing at all. for trial and error i just tried by modifying the rule like " WhatId != Null ". So when we select any id in RelatedTo field it should throw error but its not throwing.
But when i am trying to create a "Log a Call" task , then its firing the validation. Why it is happening ?
So i write a trigger on Task,
event 'before insert' and trigger fires the validation on the next page not on the same page like
"
Validation Errors While Saving Record(s)
There were custom validation error(s) encountered while saving the affected record(s). The first validation error encountered was "Please select a case...".
Click here to return to the previous page.
"
How can i achieve this ?
I have a requirement, When we select otherthan a Case on RelatedTo field it should throw error on the same page i.e Send an Email Task page.
The rule is not firing at all. for trial and error i just tried by modifying the rule like " WhatId != Null ". So when we select any id in RelatedTo field it should throw error but its not throwing.
But when i am trying to create a "Log a Call" task , then its firing the validation. Why it is happening ?
So i write a trigger on Task,
event 'before insert' and trigger fires the validation on the next page not on the same page like
"
Validation Errors While Saving Record(s)
There were custom validation error(s) encountered while saving the affected record(s). The first validation error encountered was "Please select a case...".
Click here to return to the previous page.
"
How can i achieve this ?
We can take a look at the validation first and then look at the trigger option.
Thanks,
Kaustav
You can try this validation rule
AND (
NOT( ISBLANK( WhatId ) ),
BEGINS(WhatId, '500')
)
This should stop any user who tries to create a task that is not related to a case.
Sorry for the delay in replying.
Thanks,
Kaustav