+ Start a Discussion
Alex ValavanisAlex Valavanis 

Lead workflows / process builders

I've been asked to do the following and would like to know which is the "best" quickest way. Each sales rep needs to send an email after a certain period of time. Shall i use a workflow or process builder ? Personally i have no experience in process builder and would like to know how it works.

Each sales rep (there are 6) have given me their own email templates for email 1,2,3 . Does this mean that i will create 6 process builders (or 6 workflows) ?

1. 30 minutes after lead is created - Lead status is updated to "Working-Contacted"
2. If Lead Status= "Working-Contacted" AND Lead Aging =7 then Email 2 is sent
3. If Lead Status= "Working - Contacted" and Lead Aging= 14 then Email 3 is sent
4. If Lead Status= "Working - Contactes" and Lead Aging=16 then update the status to "Close not converted"

I can feel something is wrong with my process builder. Any help?

User-added image
Charisse de BelenCharisse de Belen
Hi Alex,

What is the criteria that determines which sales rep sends the email? Is it the sales rep that owns the lead?

Also, is there a reason each sales rep has a different set of email templates? If you can use merge fields to insert user-specific information, then you should be able to fulfill this requirement within one process.
Alex ValavanisAlex Valavanis
Hi Charisse,

It is based on lead owner yes.

Yes there is a reason unfortunately, each sales rep has his own sector/ country. therefore they want to their own emails
Charisse de BelenCharisse de Belen
Ok. As far as I can tell, you cannot specify the lead owner as the sender. Someone else may have a better idea of how to do this, but I think the only way to do this is if the lead owner is the one who triggers the process/workflow by editing the lead.
Alex ValavanisAlex Valavanis
You can specify the lead owner as the sender in workflows (send from) if you go to email administration - organisation wide address.

I don't know if this can be done in process builders (have no experience in process builders hence it's a good opportunity to play around :) )
Charisse de BelenCharisse de Belen
Hi Alex, I have a couple more requirements questions:
  • What is the critera for sending Email 1? Is that sent when the status is updated to "Working - Contacted"?
  • If the previous bullet is true, then are you technically sending two emails at once? For example, after 30 minutes, you update status and send Email 1. But if Lead Aging = 7, do you also want to send Email 2?
Charisse de BelenCharisse de Belen
Disregard my previous question about Lead Aging, I just realized that this field is probably keeping track of how many days has passed since the lead was created (please correct me if I'm wrong).

My next suggestion would be to create a process that looks like this:
User-added image

The problem is that this process will not work. It sounds like you want the process to run based on your Lead Aging formula field, but changes in formula fields do not count as a "record change" so they cannot trigger actions in Workflow or Process Builder.

If you want a workaround, this Stack Exchange thread might help: http://salesforce.stackexchange.com/questions/82004/process-builder-triggering-on-formula-field-update
Alex ValavanisAlex Valavanis
Hello Charisse,

1. Lead aging calculates the creation date - conversion rate. The formula i used is:
IF(IsConverted,ConvertedDate - DATEVALUE(CreatedDate), TODAY() - DATEVALUE(CreatedDate))

2. Thank you for the process builder. My only issue is that i have 6 sales reps and each sales rep has his own email (1,2,3) Des this mean that i will create 6 process builders and if yes where is the criteria "LEAD OWNER"? (unless i'm missing something too obvious in which i apologise)

Charisse de BelenCharisse de Belen
You can create a separate process for each sales rep, or you could use the same process and add the same 4 criteria nodes for each additional sales rep. For example, you would have Sales Rep 1 - Status is Open, Sales Rep 1 - Lead Aging is 7, Sales Rep 1 - Lead Aging is 14, Sales Rep 1 - Lead Aging is 16, Sales Rep 2 - Status is Open, Sales Rep 2 - Lead Aging is 7, ... and so on.

Either way, for each of the criteria nodes, you would add this condition: [Lead].Owner:User.Username Equals String ______ and fill in the username of the sales rep. (Not too obvious, so don't worry!) You could also use any other field on [Lead].Owner:User. Here's an example using username:

User-added image

Keep in mind that this does not solve the formula field issue. Even if Lead Aging changes every day, this will not be enough to trigger the process.
Alex ValavanisAlex Valavanis
Thank you so much.

Last question: what do you mean "this does not solve the formula field issue?" and that "it will not be enough to trigger the process?"
Won't an email fire if for example lead aging = 7? 
I that's the case then i will go for a traditional workflow.
Charisse de BelenCharisse de Belen
A process or workflow is triggered when a record is created or edited. But when a formula field like Lead Aging changes from one value to another (for example, from 6 to 7), Salesforce does not recognize this as a "record edit", so neither a process nor a workflow will run.

I attached a Stack Exchange link in one of my previous replies that may be able to help you work around this problem.

Another option is instead of making Lead Aging a formula field, you can make it a number field and write Scheduled Apex to run every day, calculate the age of each lead, and then update each Lead Aging value. This should cause the process to fire.