0

What i am trying to do is when a user changes a lead status from Pre-Qualified no call to Pre-Qualified Working it updates a custom field called 1st attempt with a date and time and that update cant be changed and when they change the status field to Pre-Qualified Contacted it will update a custom field called Contacted with a date and time that cant be changed so if it goes from Pre-Qualified no call to Pre-Qualified working it updates the 1st Attempt field and the Contacted field with the same date and time.

1
  • Has to be always from 'Pre-Qualified no call' to 'Pre-Qualified Working'? Or it can every time the Status is Pre-Qualified Working? Feb 19, 2017 at 21:09

2 Answers 2

1

First, you'll need some custom fields, as you've noticed. You'll want to set the fields' security to read-only for all profiles (but admins will still be able to edit/update the field if necessary).

Next, you'll want to build a Process Builder that performs the actual updates. Basically, the flow will look like this:

[ Start ]
    ↓
[  Lead ]
    ↓
[ Pre-Qualified Working ] → [ Set Field1 ] → [ Done ]
    ↓
[ Pre-Qualified Contacted ] → [ Set Field2 ] → [ Done ]
    ↓
[ Done ]

You can build the criteria exactly as you specified; you'll just need to make sure each criteria is set to "when the record is changed to meet the criteria" under the "Advanced" section so that the date doesn't update each time the status does not change.

You'll want to go through this trailhead for a nice hands-on experience.

2
  • I think that as the poster wants both date fields updated if user goes directly from status a to c skipping b, there would need to be one additional bit of logic looking at priorvalue.
    – gorav
    Feb 20, 2017 at 1:42
  • 1
    @gorav Possibly, although the question's grammar was confusing, so I just took a stab at it. It would be pretty easy to modify the flow as necessary, though. The general idea is that we can do stuff like this using Process Builder. That's also why I recommended the trailhead for additional info.
    – sfdcfox
    Feb 20, 2017 at 2:30
1

There is a way to accomplish this with a Workflow. Either a Process Builder or a Workflow Rules will get this done. By SFDC standards Process Builder should have 'priority' except when sending outbound emails, for that you need a Workflow.

So if you want to keep it simple you can do something like this.

1: You need those fields that are going to keep track of the changes in the Lead Status field.

Create two fields, 1st Attempt and Contacted on the Lead object. Both fields need to be Date/Time fields data types.

2: Now we need to build a Workflow Rules.

3: Go to Setup--> On the Build section click on Workflows && Approvals --> Click on Workflow Rules--> click in New Rule and select Lead from the drop-down field.

4: Give a name to your flow. Select created, and every time it's edited.

5: On Run this rule if the following, select formula evaluates to true.

6: On the open section insert this:

IF(
ISPICKVAL(PRIORVALUE(Status),"Pre-Qualified no call"), AND(ISPICKVAL(Status, "Pre-Qualified Working")),true)

7: Click 'Check Syntax'. You should get not errors.

8: Click Save and Next.

After this point you should have your Workflow ready, now we need to tell SFDC to make a field update on the Lead object based on the change from Pre-Qualified no call to Pre-Qualified Working.

To do this we do the following:

9: Click on Add Workflow Action and select New Field Update.

10: Give a Name a hit tab to get the Unique Name field filled.

11: On the Field to Update select one of the fields we created on step one, for this case we use 1st Attempt.

12: After to select your field you will see a few more option under the Field to Update, select Use a formula to set the new value and click Re-evaluate Workflow Rules after Field Change.

13 Under the 'use a formula to set the new value' there is an empty block, there, insert this Now()

14 Click Save.

Make sure the Workflow is active!! You can see this on the Workflows page, if there is not a tick on the Active column, well, get inside the workflow and click on Active.

After this, you can test your new workflow. For the Contacted date/time field you need need to build another workflow if you want to use the same logic than the 1st Attempt field.

Hope it helps, let me know if you have any problems, I tested and works fine. If you want to keep track only once of the field change de-select the Re-evaluate Workflow Rules after Field Change on point 12.

Good luck!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.