You need to sign in to do that
Don't have an account?
Ankit Garg 117
Trigger to perform Multiple workflows
Hey..
I have 4-5 workflows which do the same function on the Account object. They all put a Date Stamp based on different fileds in a picklist. Since we have 5 options in a picklist and we are tracking the date of every option, I have to create 5 different workflows.
I have little to no experience working with Triggers. Is it possible to achieve this with 1 trigger?
Thanks
I have 4-5 workflows which do the same function on the Account object. They all put a Date Stamp based on different fileds in a picklist. Since we have 5 options in a picklist and we are tracking the date of every option, I have to create 5 different workflows.
I have little to no experience working with Triggers. Is it possible to achieve this with 1 trigger?
Thanks
But why not consider a Process Builder? I assume you have 5 x date fields that relate to each status.
Do one Decision point based on the Picklist changing.Then do 1 x IA where you have formula to update each of the Date Fields, using formula which tests the Status field and then updates the associated Date field. Psuedo code : NewStatusDateField = formula IF(ISCHANGED(Status) && ISPICKVAL(Status,"New"), NOW, NewStatusDateField)
Regards
Andrew
All Answers
But why not consider a Process Builder? I assume you have 5 x date fields that relate to each status.
Do one Decision point based on the Picklist changing.Then do 1 x IA where you have formula to update each of the Date Fields, using formula which tests the Status field and then updates the associated Date field. Psuedo code : NewStatusDateField = formula IF(ISCHANGED(Status) && ISPICKVAL(Status,"New"), NOW, NewStatusDateField)
Regards
Andrew
I believe your use case is that according to the type selected from the picklist you are inserting the record with the selected values and timestamp.
If that is the case you can implement the scenario using a single trigger on account object by checking the picklist value and appending the appropriate text to the account name before inserting or updating.
Of course this may vary according to your business case.
Kindly let me know if this helps and please close the thread marking a best answer and also mark a best answer so that it would be helpful in the future for others and it would help us keep the community clean.
Regards,
Anutej Poddaturi
Totally agree. I should use process builder. This will keep the implementation easy and non complicated.
Thanks for Psuedo code.
Cheers
I am tryifng to do this via Process Builder but seems to be stuck.
So I have a filed (Picklist Type) called ''Practice Stage''. I have another filed (Date Type) called ''Practice Stage Cold Date''.
What I am trying to achieve is if ''Practice Stage'' is "Cold", ''Practice Stage Cold Date'' will automatically gets updated with todays date. Similarly, if ''Practice Stage" is "Demo Booked'', ''Practice Stage Demo Booked Date'' should automatically be updated with Todays date.
Here is what I am trying under the formula on process builder.
IF(ISCHANGED([Account].Practice_Stage__c ) && ISPICKVAL(Cold), NOW, [Account].Practice_Stage_Cold_Date__c )
Surely i'm not doing this correctly.
Additionally, the formula NOW (or more correctly NOW() ) , returns a DateTime Value which is incompatible with a Date Type field. Where as TODAY() will return a Date value.
I have also found that sometimes the AND nomemclature works better than the &&. (Similarly OR versus ||)
in your case, try the code as : or alternately:
Regards
Andrew