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
SabrentSabrent 

Trigger workflow based on Picklist value

I have a picklist field Send_Notification__c with two values, 'Generic', 'Individual'
Based on the picklist value selected I want a certain workflow rule to trigger.

 

I am thinking of two workflow rules one for 'Generic' and one for 'Individual'.and then have a rule criteria,

 

1st work flow rule: ISPICKVAL(Send_Notification__c,"Generic")

2nd work flow rule: ISPICKVAL(Send_Notification__c,"Individual")

 

Is there any other better approach?

Best Answer chosen by Admin (Salesforce Developers) 
goabhigogoabhigo

What is your evaluation criteria? Is it everytime created and edited, then  ISPICKVAL(Send_Notification__c,"Generic") will trigger the workflow everytime. So better use ISCHANGED(Send_Notification__c) && ISPICKVAL(Send_Notification__c,"Generic").

 

If the email templates are different you should use 2 workflow rules.

All Answers

WorkhardWorkhard

Hi,

You are right but i just want to know that are you want different action on this workflow rule i.e. are you want two different email action??? If yes then you are right but if not then you can clud both the rule into one. One more question have you selected every time record is created or edited option??? If yes in that case evry time whenever record is updated so make your condition accordingly.

 

 

goabhigogoabhigo

What is your evaluation criteria? Is it everytime created and edited, then  ISPICKVAL(Send_Notification__c,"Generic") will trigger the workflow everytime. So better use ISCHANGED(Send_Notification__c) && ISPICKVAL(Send_Notification__c,"Generic").

 

If the email templates are different you should use 2 workflow rules.

This was selected as the best answer
goabhigogoabhigo

Is the problem solved? Let me know if you need more clarifications..

SabrentSabrent

@abhi_the_1

 

Sorry for not updatating the status. Yes, I was able to do it - programatically.

Given the complexity of the requirement this was the best possible approach I could think of -

Created a Custom field whose value is populated through apex class, based on the value, relevant workflow is triggered.

Thanks for your solution. I will remember it for future reference.