Have you ever needed to automatically update a Case when a Task was logged against it? Sounds like a simple request, right? And since Spring ’17 release it is. But that wasn’t always true with Process Builder.
A walk through history…
Two years ago Ahmad Helal submitted idea to Allow Case to be Updated once a Task is Completed via Process Builder. When Process Builder was first introduced it was not trivial to update the related Account, Contact, Case, Opportunity, etc. of a Task because the Task.WhatId field could hold ID values to different objects. It was non-deterministic what object any given Task was actually related to in the context of Process Builder and so you couldn’t run an Update Records action on the related record.
One year ago I blogged and presented about how to achieve this using workaround of custom lookup fields. In short, Process Builder was used to copy the Task.WhatId value into one of multiple custom lookup fields you added to Task object and then Process Builder could perform Update Records action via the lookup field because the ID value was now deterministic what it pointed to. Although using custom lookup fields got the job done, it still wasn’t an elegant solution to implement.
Out with the Old, In with the New
In Spring ’17 release, enhancements have been made to Process Builder so that we can easily use Update Records action for Tasks to update the related Account, Case, Opportunity, etc without any workarounds or tricks. Check out my quick video tutorial below to learn how.
HI Doug, I’m interested in doing this when an activity is logged it updates the last activity date in the lead, account, contact and opp if applicable. Is this possible?
Can you assist?
LikeLiked by 1 person
Hi Stacey,
Yes, but only if you introduce a custom Date or Date/Time field on your Account, Contact, Opportunity, Case, etc. objects to stamp via Process Builder. In my example in this blog post I update the related Case’s Status, you would instead be updating your custom Date or Date/Time field you added to your objects.
The standard field LastActivityDate is not editable, it is automatically derived.
http://www.simplysfdc.com/2014/05/salesforce-last-activity-date.html
https://help.salesforce.com/articleView?id=What-is-the-difference-between-Last-Activity-and-Last-Modified-1327108315155
LikeLike
Hi Doug, I am trying to get one task to update another of the same case of a specific record type.. Example: When Task 1 completes I want it to automatically change task 2 status to in progress and set task 2 due date to be today + 12 business days. Is there an elegant solution for this or is it even possible?
LikeLiked by 2 people
Hi Daryn,
How are Tasks 1 and Tasks 2 being created? If you control their creation via automation then this will be a bit easier.
For example, let’s say when a Case is created you want to automate the creation of three Tasks (T1, T2, and T3) and you want them to be linked together for sequential processing as per your example.
I would create a custom text field on Task object named “Previous Task ID” or something.
I would have Process Builder fire when Case is created and its Immediate Action would be to launch a Flow passing in as an sobject variable the Case itself or simply the Case ID as a text variable.
In the Flow, I would have steps to create Tasks T1, T2, and T3 in order using Record Create element. When creating the first task I would store its generated id in a flow variable, maybe called varTask1Id. When I configure the next step to create the second task I would assign the varTask1Id variable value to the Task.Previous_Task_ID__c custom field we created earlier. I’d store the second task’s id in a flow variable named varTask2Id. Do the same thing for creating the third task and link it with second task.
Ok, at this point we have when a Case is created then three Tasks get auto-created and the Task 3 has Task 2’s ID in the custom text field; Task 2 has Task 1’s ID in the custom text field.
Now I want to setup automation with Process Builder on the Task object when the Task.IsClosed = true. My Immediate Action would be to launch another Flow and pass in my Task ID as an input variable.
In the Flow, we can have a Record Update step that applies your desired field updates on Task object where the Task.Previous_Task_ID__c equals the variable value task id we passed to the Flow from Process Builder.
Hope that helps!
Doug
LikeLike
Hi Doug,
Thank you for the reply.
I have a process builder that is based on a case record type and on case creation it will also create 3 tasks ultimately 6 tasks. Task 1 and 2 are fully populated and task 3 due date is not populated as it is dependent on Task 2 completion.
I did add a sort order custom field to the task so I would have some way to have sequential processing although I like your previous task ID concept better as i wanted a way to use task_id.
I am somewhat new to process builder and I have not used flow yet but I am going to see if I can get this to work the way you presented.
I like this approach as I wanted a way to be able to pass in the task_id and say which column I wanted to update and to what value.
It does help as it is a different way of thinking than what I was trying to do.
Thank you,
Daryn
LikeLiked by 1 person
Limited success. Looks like it is creating the tasks but not relating it to the case. Is there a video you can link me to so I can perhaps see what I am missing?
LikeLike
To relate the tasks to the case, make sure to assign the Case ID value to the Task.WhatId field.
LikeLike
Thanks Doug. Your Solution is working great.
LikeLiked by 1 person
Awesome! Thanks for the feedback
LikeLike
Hi Doug,
My issue is that I have a client who uses events with multiple contacts. The problem is that the Last Activity Date field on the contact only gets updated for the Primary Contact on the event – not the other 10 or so. The activity history shows up on each of the 10 contacts but only updates the Last Activity Date field on the primary contact…grrrrr.
I know these are logged in the Task Relation object but I cannot figure how to do this. Any ideas?
LikeLiked by 1 person
Hi Jane,
Per Salesforce, the Last Activity Date with Shared Activities enabled is only updated for the primary Lead/Contact on the Task (Task.WhoId). The Last Activity Date is not updated for any of the other Leads/Contacts that may be related via the Task Relation object for the shared activity.
https://help.salesforce.com/articleView?id=activities_shared_differences.htm
You can try what I suggested to Stacey and create custom date fields.
LikeLike
Hi Doug, first of all thank you for this video – I am so excited that SF have introduced this feature (I was going to attempt Flow…eek!) . However, I had set this up to the letter as per your video and I was getting the Workflow error when I save the Task.
After a couple of hours I worked out there was a validation rule that was stopping me.. all good now 🙂
Thanks again for sharing!
LikeLiked by 1 person
Thanks for the kind feedback, Sarah! Glad you got it working =)
LikeLike
I do have a question… how do I restrict this for certain roles only (i.e. role name contains BDM). Usually I would use the formula function but Im not sure using the Lead ID Functionality would work in formula?
LikeLiked by 1 person
You might try adding a condition on [Lead].LastModifiedBy.UserRole.Name starts with “BDM”
LikeLike
Hi Doug,
So I am trying to go in the reverse direction here. I have 3 fields (2 picklists and one lookup) that I want to copy the field choices from the lead to the task when it is created. I tried to create an auto-launched flow via PB that looked at the task and grabbed the WhoID of the lead and then Looked up the info I wanted and then went to a record update of the task and updated the fields but I was not able to get it working. I was hoping you might know of a more efficient way to achieve this? Thanks!
LikeLiked by 1 person
Hi Steven,
What was not working for you? Did you get errors?
Could you share screen shots of your configuration. Feel free to upload a file with them to Success Community, Google Drive, or wherever and share a public link here.
Thanks,
Doug
LikeLike
Hi Doug! I am doing a similar update however the field I am trying to update is a Lookup field (User Lookup). However I can’t seem to get the User ID from the “Task” object in order to update the “Case” object. Is there some special requirements for User Lookup Field updates?
LikeLiked by 1 person
Hi Sarah,
Could you share some link to screen shots of your config?
I was able to achieve this in my org. In Process Builder when configuring your “Update Records” Immediate Action, choose option to “Select a record related to the Task” and in that picklist choose “Related to ID (Case)”.
Then when choosing which Case fields to update, select your Case’s User Lookup Field as the “Field”, select Reference as the “Type”, then for “Value” select the User Lookup Field on your Task you want to copy over.
For example, I created a process that upon Task completion is changes the owner of the Case to be the user assigned to the Task.
https://success.salesforce.com/0693A000006KBiHQAW
Doug
LikeLike
Doug,
Thanks for taking the time to look at this. I’ve been searching everywhere and still can’t find why my Process Builder screen doesn’t quite look like everyone else who posts. Notice my “Record” area is “Record Type”. Then when I choose the field I want to use to update- User ID isn’t even an option. Neither is the field name that contains the user (Rep Name)
https://success.salesforce.com/0693A000005eLY2
LikeLiked by 1 person
I agree, the “Record” vs. “Record Type” labeling is confusing in Process Builder because “Record Type” has other meanings when configuring objects. In this situation, the two terms mean the same thing — which record are you wanting to update. I believe it displays “Record Type” when you are editing the Immediate Action but “Record” after you’ve saved it.
Now, compared to my earlier screen shot, yours looks to be trying to update a record via lookup field on an object named Account_Assignment_History__c and not Task, is that correct?
The “Record Type” you choose in your screen shot needs to be the record that you want to update (that is, whose field values you want to change). In your screen shot it looks like you might be trying to reference the record that has the field value you’re wanting to assign. So this may just be a mixup of using wrong selector on the form.
LikeLike
Hi Doug…thanks for much for this video, it saved me a ton of time, as many of your posts do!
Just wanted to note one small hiccup I had. I wanted to do almost exactly the same type of update as in your example, but with a Lead instead of a Case, and I could not get the dang thing to work. Finally found that I had to change the initial “Is it related to a Lead?” criteria from [Task].WhatId starts with “00Q” to [Task].WhoId starts with “00Q”. Once I did that it worked perfectly, but just not sure why.
Thanks again!!
LikeLiked by 1 person
Hi Jon,
Thanks for the kind feedback, glad you liked the video!
The reason you had to change from [Task].WhatId to [Task].WhoId is that Contacts and Leads are “humans who the task is related to” and all other kinds of objects (Accounts, Opportunities, Cases, etc.) are “what the task is related to”.
The WhoId can be assigned to Contact and Lead IDs only.
Hope that helps clarifies!
Doug
LikeLike
Hi Doug,
This is a few months old, but I hope the question still gets to you.
I very thankful to find the video, because I was attempting to do the update with a flow, until I came across your post. In my scenario I’m trying to update a custom field on lead named activity_count__c every time a new task is created on the lead. However, I can’t seem to create the formula field to use activity_count__c + 1. Any suggestions for adding the correct field?
LikeLiked by 1 person
Hi Miriam,
Glad you liked the video, thank you for the kind feedback.
Regarding the formula expression for Activity_Count__c +1, what have you tried so far? Please provide a link to screen shot(s) of your configuration to assist in troubleshooting.
Thanks,
Doug
LikeLike
Hi Doug,
Thanks for responding. When clicking on formula I don’t get the option of selecting the lead field I need to use in the formula (activity_count__c = activity_count__c + 1), so I just used + 1 in the formula and it’s not increasing the activity_count__c field by 1.
LikeLiked by 1 person
Hi Miriam,
I just had a chance to try this out and confirm it is possible, so that’s good news!
On your Lead object, make sure the field “Activity_Count__c” is type Number and not a Formula field, otherwise we won’t actually be able to update its value.
In Process Builder, when you define your Immediate Action to update the Task’s related Lead record (the field label in the autocomplete box will show up as Name ID (Lead)), use this formula expression as the value to assign to the Lead’s Activity Count field:
BLANKVALUE( [Task].Lead.Activity_Count__c, 0 ) + 1
Hope that helps!
Doug
LikeLike
Hi Doug,
Fist of all Thank you so much to your video, after seen your video, i am trying to shift all apex triggers customization on tasks to Automation process.
but i struck up where i have to assign the value by using formula to my contact custom Date field it’s show error like below
error:The formula expression is invalid: Field Task.contact.Follow_Up__c does not exist. Check spelling.
scenario: when ever task is completed on contact iam going to update the contact custom date field by using formula like below
Field: Contact.customdate__c
Type:formula
in Value : i enter
CASE(
TEXT( [Task].contact.Follow_Up__c ),
“Weekly”, TODAY() + 8,
“Bi-Weekly”, TODAY() + 14,
“Monthly”, TODAY() + 31,
“Quarterly”, TODAY() + 92,
“Semi-Annual”, TODAY() + 183,
“Annual”, TODAY() + 365 ,
NULL
)
Can you please help to how to add value using formula
LikeLike
sorry after i make “C” to upper in contact name i am getting below error
The element has an invalid reference to “Task.Contact.Follow_Up__c”.
LikeLike
Hey Doug — I’m running into an issue with the formula you suggest in the previous reply.
I have a custom field on Lead called “Number_of_SDR_Attempt_Calls__c”
I need that field’s value to increase by 1 every time a task {with specific criteria} is completed. I can set the field to an explicit value but when I try to use a formula like this:
[Task].Lead.Number_of_SDR_Attempt_Calls__c + 1
I get the following error: The element has an invalid reference to “Task.Lead.Number_of_SDR_Attempt_Calls__c”.
LikeLike
I ran into the same issue. I am going to update a Lead record but I am not seeing the initial “Is it related to a Lead?” criteria. Where do I see this?
LikeLiked by 1 person
Hi Chester,
The “is it related to a Lead?” is the label we gave to the blue diamond criteria step in Process Builder.
LikeLike
Hey Jon and Doug. I also am trying to get this set up for a lead status change, i have changed the [Task].WhatID to [Task].WhoID but cannot get it to update my lead status. Is there another change i need to make?
LikeLiked by 1 person
Hi Seth,
Please provide links to screen shots of your configuration to assist in troubleshooting.
Thanks,
Doug
LikeLike
Hello Doug,
Thanks for the video. I have one question how to add incoming email to case related list
I enabled t email to case in my org. cases are creating when emails comes in once case is closed some one reply to the email it is adding to same case. so i created a process builder to create new case when case status closed. everything is working fine. but i am unable to add incoming email to newly created case email related list
Hope i explained my question clearly
Thanks,
Deepthi
LikeLiked by 1 person
Hi Deepthi,
Glad you liked the video =)
In standard Email-to-Case, the inbound email from a customer will automatically be added to the matched case’s related list. In your scenario, the inbound email is being added to the original case which is now closed.
Sounds like you have custom logic on EmailMessage object that if the parent case is closed then to create a new case. And sounds like that piece is working fine. Your ask is then how to get a copy of the inbound email added to the new case’s “Email Messages” related list?
Since Salesforce already related the inbound email to Case 1, you will have to manually create a copy of the inbound email onto Case 2, just as you are manually creating Case 2.
You might consider doing this extra effort in a Flow and having Process Builder simply monitor when inbound EmailMessage is created on a closed case then invoke your Flow, passing in as an input variable a copy of the EmailMessage record.
In your Flow, create the new Case then create a new EmailMessage record with same subject/body/etc. as the original EmailMessage but this new record to be related to the Case your Flow just created. If you create the Case in Process Builder you won’t know the ID to then relate a new EmailMessage to it in the same transaction. This is why I propose you do the heavy lifting and record creation in the Flow that your Process launches.
Doug
LikeLike
Hi Doug,
This is a bit backwards from what you are discussing here, but using the process builder, I am trying to have a task created once a lead is converted to an Account. Everything works well with the exception of the ‘Name’ field. It’s the associated ‘Contact’ record on the Account, but I cannot seem to access it in Process Builder. In the perfect world it would default to the contact associated to the Account. In our org we only have one contact associated to the Account.
Is this possible in Process Builder?
Thanks so much for any thoughts!
Matt
LikeLiked by 1 person
Hi Matt,
For what I think you want to do is more akin to https://douglascayers.com/2016/11/23/how-to-update-tasks-on-lead-conversion/
Have Process Builder monitor when Lead IsConverted becomes true then have action create a task. Set the WhoId to Lead.ConvertedContactId and WhatId to Lead.ConvertedAccountId (or Lead.ConvertedOpportunityId)
LikeLike
Doug,
Thanks for the quick reply. That worked and I am off and running.
Thanks for all you do for the community!
Best,
Matt
LikeLiked by 1 person
Hi Dough, Thanks for the video this is definitely what I am looking for. I have done exactly what you have done but on the lead object. It is working when I hit ”log a call” button in my company org but not when I am sending an email from the lead object or using BCC or using the lightning to salesforce app in my outlook. I have mirrored this in my dev org and works perfectly. The only thing that I can think of is that I am missing a setting or a setting is stopping this from working. Any ideas?
LikeLiked by 1 person
Hi William,
By chance does your company’s org have Enhanced Email enabled? If yes then you may need to have Process Builder run off EmailMessage object too.
The EmailMessage object has an ActivityId field that will point to the underlying Task record. You may need to have your Process run on EmailMessage to launch a Flow that looks up the what/who of the email’s activity then do your update.
LikeLike
Hi Doug,
Thanks for this write-up, but my instance does not have this ActivityID field listed under the EmailMessage object, it doesn’t exist. Where you able to actually solution this issue another way?
LikeLike
Hi Sam,
The ActivityId field may not be shown in Object Manager of Setup in Lightning Experience, but it is a field on the EmailMessage object. You can use Developer Console to open the object definition file or run a SOQL query like
SELECT Id, ActivityId, Subject FROM EmailMessage WHERE ActivityId != null LIMIT 2
to see the data.Because the field exists, then the solution I proposed in my earlier comment should work by having Flow perform a Fast Lookup on the EmailMessage object to obtain the ActivityId. Once you have that ActivityId, then you can update the Task record that ID points to.
Hope that helps!
LikeLike
If any custom date/time fields in case needs to be updated when task – email is created on case , It works well when process builder is created on EmailMessage object .This object can be related to case and will do the work.
LikeLike
Hi Doug,
I have a request very similar to this, but I have doubts I can do it with process builder, or declaratively at all for that matter, as I want the update to be dynamic. Specifically, I’d like a check box checked on leads when there is at least one associated task with a due date in the future.
Regardless of if the task is later updated or marked as closed, I would like the check box to be unchecked automatically once the current date has surpassed the due date of all associated tasks.
Before going down the rabbit hole, I’d greatly appreciate any thoughts you might have.
Best,
Matt
LikeLiked by 1 person
Hi Matt,
What will you use this checkbox for?
Sounds like a Report would get you the information that you need.
Doug
LikeLike
Hi Doug,
We still use Partner Portal Licenses. Cross object filters are not available for those licenses. So when I use a cross object filter to show leads without tasks with a due date greater than today the cross object filter falls off in the portal. The leads with activities report, or vice versa, pull multiple entries for the same lead which is not what we want.
My thought was with this check box, I could then just use a standard lead report and get the right records based on that check box circumventing the fact that cross object filters are not available for our partner users.
I may be missing something though.
Best,
Matt
LikeLiked by 1 person
Hi Matt,
My preferred design for that is use Andy Fawcett’s Declarative Lookup Rollup Summary tool to stamp the max Task.ActivityDate on a custom date field on your Lead object. Let’s call this custom field Max_Activity_Date__c.
By using Andy Fawcett’s app in essence a trigger on the Task object would get deployed for you and would keep the Lead.Max_Activity_Date__c value current any time new tasks came along, existing tasks’ date changed, or a task got deleted.
Then, introduce a custom formula checkbox field on Lead named something like “Has Activity in Future” with expression “Max_Activity_Date__c >= TODAY()”.
Then you would be able to create standard Lead report filtering by “Has Activity in Future” equals TRUE (or FALSE).
If you don’t anticipate Tasks being deleted then you might be able to get away with a purely declarative approach by having Process Builder launch a Flow that runs a Fast Lookup or Record Lookup step to find the most future date Task related to the Lead similar to Jennifer Lee’s post Record The Last Call Made to a Contact.
LikeLike
Hi Doug,
I am using Email to SF Bcc to create a task on contact everytime the email is logged. I would like to relate the task to a custom object. The contact has a lookup field to the custom object and can also be related in the task object. Is there a way to automate the process of task record automatically associated the task record to the contact and custom object? Thanks!
LikeLiked by 1 person
Hi Quan,
To my knowledge, the only way to add automation when using Email to Salesforce is with Apex Trigger. For whatever reason, Process Builder does not fire when the Task (or EmailMessage) records are created in this scenario.
I found similar question with answer being need to use apex trigger.
In my dev org, I also could only get apex trigger solution to work.
If, however, you would happen to know the Salesforce record ID of that related custom object then according to the documentation then you should be able to include that record ID in the subject or body of the email and Salesforce would relate the email to it for you.
Doug
LikeLike
Hi! I tried to update the Lead Source based on a specific text in a Task’s subject line. When I went to the step where you select a record to update, there was no “Related to ID (Lead)”. Any insight on how I could update the lead object?
LikeLiked by 1 person
Hi Gabriel,
On Tasks, “Contacts” and “Leads” are associated via the Task.WhoId field and all other objects are related via the Task.WhatId field.
The WhoId is labeled “Name” on the Task page layout and WhatId is labeled “Related To”.
In Process Builder, when configuring your Update Records action and you choose “Select a record related to the Task” then the label of the task field you want for Leads will be “Name ID (Lead)”. In the search box you can simply type “lead” and it will filter to the correct field to select.
After selecting “Name ID (Lead)” you can then configure the field updates on the Lead record.
Make note, in your Process Builder’s Decision Criteria you may want to ensure that the Task.WhoId starts with “00Q” which is the object key prefix for Lead record IDs. That way your logic doesn’t try to fire on a non-existent related record.
Hope that helps!
LikeLike
Worked like a charm, I realise I had to mass-update all relevant tasks to get the workflows working. This process builder feature is absolutely fantastic! Great video introduction. Thank you very much for making this available and answering.
LikeLiked by 1 person
You’re welcome, glad you got it working!
LikeLike
Hello Doug. Your advice seems to have helped many. My issue is similar in that I am trying to update the Lead when an Event (not a task) has been completed. Is there anything different there? I have followed your instructions to the T and it seems like it should work but no.
LikeLiked by 1 person
Hi Jamie,
There’s no trick for this to work with Events. I just tested with a process on Event object and my decision criteria checked the [Event].WhoId and if it starts with the formula value “00Q” then I know the event is related to a lead.
From there, you can add an action of type “Update Records” and whose record type is “Select a record related to the Event”. The related record will be “Name ID (Lead)”. From there you can assign fields to update.
To further troubleshoot with you, please share screen shots (can be a link to them on Trailblazer Community) with your process’ configuration.
LikeLike
I’m trying to build something similar. I’m looking for something to add and subtract pt values based on a logged activity. Wondering if your process would lead me in the right direction…any gotchas or other items to consider?
Background –
Building a custom Client Appreciation Program object. This will track points for references, case studies, presentations. When the activity record picklist value is success story a score of +10 will be added to the Appreciation Points field. At a certain point they can cash out their pts for gifts (swag, gift cards, etc). So if the activity is gift card, I want to reduce the score field by -25.
How can I use would use Process Builder to add and subtract values from your point fields.
Objects
Client Appreication
Fields
Account Lookup
Contact Lookup
Appreciation Points – Number field
Task Record
* Type Picklist
Reference Call
Industry Media Interview
Press Release
Company Name & Logo
Testimonial Quote
Infographic
Testimonial Video
Success Story (+10)
Focus Group (+35)
Webinar (+30)
Speaking Opportunity (+10)
Redeemed Gift Card (-25)
Thanks inadvance. Chris
LikeLiked by 1 person
Hi Chris,
For this type of application then I’d recommend a different approach to handle when the Task Type changes, Tasks get re-parented, or Tasks get deleted.
I would use Andy Fawcett’s Declarative Lookup Rollup Summaries app that can implement multiple “rollups” counting the number of Tasks of different types.
I would create a formula field on the Task object that yields the number of points it represents based on it’s Task Type. Then use DLRS to configure a single rollup to one custom number field on your Client Appreciation object.
Doug
LikeLike
Is it possible to use this to take an inbound email on a closed case and change the relationship of the email to the a new case that is created when a response is received on a closed case?
Is seems most solutions are to “copy” the inbound email to the new case but I’d prefer to move the email to the new case.
LikeLiked by 1 person
You can try updating the ParentId field on the EmailMessage record, but I think once the status field is no longer “Draft” that it is locked from editing. If you can’t re-parent the EmailMessage then you’d have to just create a copy of the record and save the new copy on the new case.
LikeLike
Thanks. That’s what I was afraid of. I get it, just hard to explain to people who could move them in another system why it cannot happen here.
LikeLiked by 1 person
Hi Doug,
This is such a detailed post, thank you so much for sharing this, the video you have made makes it all the more easy to follow the steps and adopt it in our respective projects.
Your post proved extremely useful for me to adopt in my scenario where I needed to update a custom field of a custom object by picking the value from a custom field on a standard object (Task).
The one problem I am facing however, is to use the Salesforce ID of the Custom Object in the What ID filter. This is because the Salesforce ID of this custom object is different in each sandbox. So after deploying the process builder from sandbox to production, the ID in the WhatID filter needs to be changed manually. Do you know of any workaround for this little hiccup?
Best
Surabhi
LikeLiked by 1 person
Hi Surabhi,
I’m glad you liked the blog post and found it useful!
A way to insulate your processes and code from IDs changing is to store the IDs in configuration metadata, like a Custom Metadata Type or Custom Hierarchical Setting.
As you create the object new in each environment (sandboxes, production) you still have to determine the new ID and update the custom metadata type or custom setting with the value. However, you don’t have to keep updating your process builder because it always refers to the custom metadata type or custom setting.
Check out Jen Lee’s post about Use Custom Settings in Process Builder for example.
LikeLiked by 1 person
You can also check out Jen’s post (Spring 18 Preview) Reference Custom Metadata Type Records in Validation Rules (Pilot)
https://jenwlee.wordpress.com/2018/01/30/spring-18-preview-reference-custom-metadata-type-records-in-validation-rules-pilot
LikeLiked by 2 people
Thanks a lot Erik, the references made my job a whole lot easier.
LikeLiked by 1 person
Thank you yet again Doug, your suggestion was very useful and has solved my problem !
LikeLiked by 1 person
Doug can I reference this post to update/populate tasks with lead data?…and just switch the order around? Any idea how I would run for all leads…would I just run a mass update on a random field…thanks
LikeLiked by 1 person
Hi Joseph,
Well, technically yes, you could have a Process Builder on the Lead object and when it fires then to have an Update Records action that applies field updates to some or all of the lead’s related tasks.
However, depending on the number of leads and their related tasks you want updated then you may exceed governor limits.
One lead can have 0, 1, or many related tasks. So what you’re asking to do by inverting what my blog post is about opens you up to a much larger potential data volume to handle.
What is your use case? Why do you want to do this? Is this a one time thing or you expect all the related tasks of a lead to continually be updated as the lead changes?
To answer your last question, yes, to cause all leads to be processed you need to fire an update on the records with Data Loader or something that will cause the leads to meet the criteria of your process builder. You might also be interested in my other project, Mass Action Scheduler.
LikeLike
On a seperate note, I think you did a post (and I can’t find it again) about copying text fields from a Lead and creating a new note on the contact. One issue with it at the time was that SF inteprets some of the text as HTML and the note creation fails. Does that sound familiar?
LikeLike
i guess more simply, i want to put like 2-3 fields on a task from the lead object. is there a better way to do this, all me reading leads to a solution like this but i may have missed something. Thanks for the response.
LikeLiked by 1 person
Joe, if you want to copy field values from a lead into a NEW task, then that is easy to do. The process on your lead record would have a “Create Records” action that creates a Task record and you map lead field values into it.
Another idea is to create formula fields on the task object that reference fields via the lead lookup relationship. In Setup menu this is done by adding custom fields to the “Activity” object, which is the common object behind both Tasks and Events. By using formula fields you get out of needing a process builder or backfilling data, but the fields on the task always display the current values on the lead. So if the task needs to be a snapshot of the lead data when the task was created, then this may not be the right solution. But if you just want to see the lead field values when on a task record, then this may be what you want.
LikeLike
doug the second option would be ideal however you can’t use a formula here, am i missing something? you mentioned lookup values and i’m not sure how that relates or how i would incorporate that into a formula field
LikeLike
Hi Doug, this post seems just like what I need but am running into some issues.
I’m trying to keep track of the most recent date that a file was received (which is stored on the EE Log) on the account object. My problem is that I’m having trouble relating the EE Log to the account to select the fields I want to update. Any suggestions?
LikeLiked by 1 person
Hi Pawel,
What have you tried so far? Please provide links to screen shots of your configuration to help with troubleshooting.
Thanks
LikeLike
Hello Doug,
You seem to be the man when it comes to weird ways of using Process Builder. 😉
We’re on Professional edition.
I need to create a series of followup tasks on lead records, one at a time, but only when the lead status is Not Attempted, or Attempted. I can create the first task easily enough, and I can create a followup task on that lead when a preceding task was completed. But I’m not able to make the followup task creation conditional on lead status.
I’m using your idea about a Lead lookup field on the task record. The lookup field name is Associated_Lead__c. When I create the first task, I insert the lead ID (WhoId) into the lookup field on the task. When that task gets completed, I’m attempting to access the value of the lead’s Status field to see if I should proceed to create the next task. Screenshot: http://prntscr.com/jehhnt But when the process gets triggered, it drops a Flow Application error, saying the status field is not set or assigned. Given that the Associated_Lead__c field holds the correct value for the lead (screenshot: http://prntscr.com/jehk4x), there must be some reference error going on.
Any advice would be greatly appreciated!
Don
LikeLiked by 1 person
Hi Don,
Wow, sorry for the late reply, I missed your comment earlier and am just now seeing it =/
Hopefully you’ve resolved this by now. My guess is that the logic that populates the
Associated_Lead__c
field is running AFTER your process that creates the tasks, and perhaps the problem is an order of operations problem.LikeLike
Hi Doug,
I have been struggling to update Lead from User object. I want to change the Lead.OwnerID with a custom field I added to User, User.Replaced_By_ID__c.
I didn’t think I could relate anything to Lead, but you seem to have proven its possible.
My thoughts are…when User.Replaced_By_ID__c is updated I want to select any Leads where User.ID = Lead.OwnerID and where a match is found change Lead.OwnerID = User.Replaced_By_ID__c.
Does this sound feasible?
LikeLiked by 1 person
Hi Bob,
Yes, that’s possible. However, it’s a tad bit more complicated with User object because you can’t create custom lookup fields on User to other objects.
One way to do what you’re asking is to create a Process Builder on the User object with your criteria of the user’s field value changing. Normally, you’d be able to use an immediate action to update related records of the object that Process Builder was defined on (e.g. a process on Account can update all its related Contacts), but with User object we don’t have that option.
Instead, your process needs to launch a Flow that then uses a Record Update statement to set the new owner field value on Leads owned by the current user.
Depending on the number of leads that need to be updated, you may run into governor limits and this solution won’t be appropriate and instead you’ll need batch apex to process the large volume of data asynchronously.
LikeLike
Hi Doug,
Thanks for the post. I’m trying to create related list to filter out the Pardot created tasks from the Activities History on Account/ Contact. All the Pardot related activities have; Task Type= Email and Created by=Pardot Connector user.
I’ve created an Activity Custom Field to have non-pardot activities in. In process builder, I added condition on Task Object, 1. Task.CreatedBy.ID Does not equal Pardot connector user’s ID, 2. Task.Task_Type doesn’t not equal (String) Email,Downloaded
It’s still showing the pardot activities, like the default Activities History.
What conditions can filter out the pardot activities from the new related list? Please help.
Thank you very much for your time and effort.
LikeLiked by 1 person
Dear Doug,
I managed to create related list for Activities for the sales reps where only visits and tasks shows up without pardot related tasks. Two process builders (2); Task & Event are populating into related list when task has WhoId is of an account (Pardot tasks don’t have WhoId attached) and they’re working fine. Thank you for the video.
Now that I need to upload the Activity IDs back in SFDC for the PBs (2) to fire, I get Flow error message, some records are obviously updated not all.
Again, thank you for your blog the video was very useful.
Best,
Jami
LikeLiked by 1 person
Hello Doug,
I am trying to do the same thing as you have showed in your video. It is working good for moving to next stage. But i am having a total of 7 stages. when i developed and activated the process builder for all the 7 stages, when ever a task is marked completed it is skipping stages. Can you help me out on this.
Thank you.
LikeLike
Not sure if you’re still checking these, BUT. I was wondering if this is possible if there are more than one who.Id?
With the SF extension, we can log calendar events to objects. We have two custom objects: meetings and attendees. I wanted to be able to log calendar events to a meeting (Which in turn creates an event record, with the meeting as the WhatID, and then a bunch of Who.Ids), and then cycle through those Who.Ids and create Attendee records with their name and meeting in the record.
Your process works, but only for the first contact. It doesn’t do it for all the contacts in the Who.Id field.
LikeLiked by 1 person
Hi Nick, to handle multiple WhoId’s, please see this project.
LikeLike
This is soo helpful! thx! Can the process be changed to just change the case status field when an email task is completed? rather than just any task. Would I use a filter based on the task subtype?
LikeLiked by 1 person
Hi Daniel,
Glad you found this solution helpful.
You can add more criteria to the process if you wish. To filter by tasks related to cases, you’d inspect the [Task].WhatId to start with “500” (the object key prefix for Case).
LikeLike
Doug,
I am trying to adapt what you showed to update a field on a lead when the associated case is closed but can’t seem to get the related lead. Can you assist?
LikeLiked by 1 person
Hi Roman,
To my knowledge, there is no standard Lead field on Case object, so if your Case records are associated with Leads then that must be coming from a custom field.
If the Case has a lookup field that references a Lead, then a process on the Case object can use an Update Records action to update that field reference.
More details are in the docs.
If you’re not seeing the field in process builder, ensure your user has field level access to the field.
LikeLike
This is a life saver for me because I don’t know Apex programming and I’m not familiar with Flow. I needed to update a customer date field on the Account record to get the latest date of a Call Task record. So, Thank you very much for taking the time to posting this!! You explained it very well and easily demonstrated it the video you that I could create it myself in my own org.
LikeLiked by 1 person
Glad this was helpful to you, Martin! Thanks for the kind feedback 🙂
LikeLike
Hi Doug,
Is it possible to update a related record from process builder and the change be dependent on criteria a criteria from the related record?
In this use case when the Parent Record achieved the Status “Completed”, the Child Record should copy the Value from Child Field A to Child Field B.
It seems we cannot reference field from the Child Record itself.
Many thanks in advance.
Miguel Fernandes
LikeLiked by 1 person
Hi Miguel,
If you want actions to occur when the parent record values change, then you need a Process Builder on the parent record. It would have an action to Update Records to update your desired child records.
Your processes on child records can reference the current field values on their parent record, but cannot determine if the parent record’s value has changed because the process on the child record is only monitoring changes to that child record.
More details are in the docs.
LikeLike
Is there any way to do with with an Event? I’m trying to Update a field on an Account record for “Last Meeting Date” when an Event(Meeting) is completed.. but there’s no real “completing” an Event it seems… You can report on Events, they get marked “Complete” if the ActivityDate is in the past (I believe..) but this doesn’t seem to trigger a true Record Update to run a process or workflow… Is there no way to do this declaratively?
LikeLiked by 1 person
Hi Chris,
You might consider using my other app, Mass Action Scheduler, where you could run a report for Events whose end date is “yesterday” and then have those records run through an invocable process or autolaunched flow to execute your logic.
Doug
LikeLike
Hi Doug,
I want to oblige muy users to logg an activity (mail or call) and consequently fill automatically the Last Activity Date formula field I’ve created (Formula LastActivityDate).
But my validation rule doesn’t work :
And(
IsConverted = true,
ISNULL (LastActivityDate))
In my researches, it says this field turns always to empty for the conversion….So a conversion rule is impossible..
Do you have any solution (without code :)) ?
Thank you
LikeLike
I am trying to do something similar. Any advice would be great.
Tasks are created by another process.
I then want the Task Process Builder to change the Assigned To field on the Task based on a few related Lead fields.
How can I get to the Lead fields from the Task process builder?
Example:
Task is assigned to default owner through another process
Use Process Builder – Task object to look up the Task’s related Lead object and see if Subject = XXX and a pick list field = XXX and if both are True change Task Assigned To – user XXXX
LikeLike
Hi Doug,
I do not see PB firing event when Email activity happens. Is there any special condition to handle email activity?
I have created PB on Task (Created and edited) and condition is “WhatId” starts with “006” (opportunity object), update Opportunity object field with current date time. It works great when we create a task, however email activity fails.
Any help is appreciated!
Thanks
LikeLike
Hi Doug,
I am having the same problem as Naveen above. Is it possible to log Email activity via Process builder in Professional Edition? Works great when other tasks are logged.
Thanks for a great solution!
LikeLike
Thanks Doug, very informative. I’m a Salesforce consultant 6 times certs and that was new to me. But don’t tell my clients 🙂 Your delivery was just right. Thanks for the putting the work in for this site as I know its not trivial. Simon
LikeLiked by 1 person
Hi Doug,
Can you please help me i want to schedule based on cross object fields is it possible in process builder?
For Example, i am writing a process on child object . Criteria is based on the parent object and i scheduled based on the fields of child object I observed whenever a record is created with all the conditions it is not firing .Suppose if i inserted a new child record to the existing parent record then it was firing any idea about this issue.
Thanks in advance:)
LikeLike
Hi Doug,
I have a field on a custom object named ‘All Tasks Completed?’ – Yes/No. I want to read all tasks related to this custom object and if the status of all the tasks is complete then I want to update the field ‘All Tasks Completed?’ = Yes. If even one task is not complete then ‘All Tasks Completed?’ should be set to ‘No’
Can I achieve this through the process builder?
Thanks,
Swapnil D
LikeLike
Hi Doug,
First off, love the content.
I’m trying to update a lead status upon the first logged outbound email from our sales team. Can you point me in the right direction here? I know I’m close…
Working in the Task Object:
Set Conditions:
[Task].WhatId EQUALS ID 00Q (I’ve also tried WhoId, got neither to work though)
[Task].IsClosed EQUALS Boolean TRUE
[Task].Subject STARTS WITH String “Email:”
Conditions: ^ All conditions are met
Update Records:
Record = [Task].NameId (Lead)
Criteria for Updating Records = updated records meet all conditions
Filtered records:
Status = Picklist “New”
New Field values:
Status = Picklist “Working”
Not sure if you reply to these anymore, but in case you do!
LikeLike
Hello Doug,
Great job posting so much information!
I would like to ask you something.
Since quick actions are not available in related lists, I was thinking that with your tip (using Process Builder to Update Related Records) it would be possible.
Let´s say I create a quick action to change a field of a record. And with PB I associate that field together within the two objects. So, I use the quick action to change the field of the main object, and then the field of the related record changes too.
Does it make sense? Any other work around ideas?
LikeLike
Hi Doug!
Your video tutorial helped me a lot! Thank you! I wonder if there is a chance to update a custom Dare/Time field on Account record every time a Note is created? Because I see that Process Builder doesn’t provide access to the Note object. In my case I have to use Task object as a workaround.
LikeLike
Hi Doug,
I am trying to copy over the most recent event to the related contact. When the final event notes are saved I want that to trigger the event name to be posted on the related contact record in a Recent Event custom field. I’ve seen a lot of info on posting the recent event date but I cant figure out how to post the event name to the contact record. Any help would be great!
LikeLike
Hi Doug,
I have a button send email in the case object and want to update the field on the case field when a user clicks on the send mail button(action) using process builder how do i do? Case owner should the logged in user and CaseOwner is in Queue.
LikeLike
Hi Doug,
I am not sure if this a similar issue but I am to trying update a text feild (SNmae) in my Tickets object whose value updates from a picklist feild Unit ID in the related object Resources. One ticket can have more that one Unit IDs attached to it. When a new value is added to the Unit ID feild the value gets appended to the one already present in the feild SName on the Ticket. But how to go about it if one of them is changed?
The logic of what could be done maybe is to delete everything in the text feild and update again all records in the Unit ID feild from the related resource object. However I am not sure if this would work or I need to do something else as well ?
LikeLike