Lead that Did Not Convert to Customer Within Three Days
The following sample shows how to create a workflow that notifies a sales rep if a Lead record did not convert to a Customer record within three days of Lead record creation.
The example uses a workflow field, Lost Lead Email Sent, on the lead record form to track if the sales rep was notified. A saved search identifies leads created three days before the current date. The workflow runs the saved search on a schedule and sends the email to the sales rep of the leads that have not been converted to customers in three days that meet the saved search criteria.
To set up the workflow, complete the following steps:
-
Create the custom field for the Lead record. See Step 1 Create the Custom Entity Field for the Lead Record.
-
Create the saved search. See Step 2 Create the Saved Search.
-
Create and schedule the workflow. See Step 3 Create the Workflow and Set the Schedule.
Step 1 Create the Custom Entity Field for the Lead Record
Create a custom entity field for the Lead record form. The field tracks if the sales rep was notified of leads that did not convert. The workflow sets this field to true when the workflow sends the email. This field is set to false for all leads by default.
The saved search uses this field as search criteria, so you must create the field before you can create the saved search.
To create the custom entity field for the Lead record form:
-
Go to Customization > Lists, Records, & Fields > Entity Fields > New.
-
On the New Custom Entity Field page, enter the following properties:
Property
Value
Label
Lost Lead Email Sent
Type
Check Box
-
On the Applies To subtab, enable Customer.
-
Click Save.
-
Continue to Step 2 Create the Saved Search.
Step 2 Create the Saved Search
Create a saved search to find lead records created more than three days ago with the Lost Lead Email Sent field equal to false.
To create the saved search:
-
Go to Lists > Search > Saved Searches > New.
-
On the New Saved Search page, click Customer.
-
In the Search Title field, enter Lost Lead Email Search.
-
On the Criteria tab, enter the following filter criteria in the Filter field:
Filter
Criteria
Date Created
before and 3 days ago
Stage
any of and Lead
Lost Lead Email Sent (Custom)
No
-
Click Save.
-
Continue to Step 3 Create the Workflow and Set the Schedule.
Step 3 Create the Workflow and Set the Schedule
Create a workflow for the Lead record and set a schedule for the workflow. Create a single state with a Send Email action and a Set Field Value action for the Lost Lead Email Sent field on the Lead record.
To create the workflow and workflow actions:
-
Go to Customization > Workflow > Workflows > New.
-
On the New Workflow page, enter the following properties:
Section
Property Name
Value
Basic Information
Name
Lost Lead Workflow
Record Type
Customer
Sub Types
Lead
Release Status
Released
Initiation
Scheduled
checked
Schedule
Saved Search Filter
Lost Lead Email Search
Repeat
check
Frequency
Every 30 minutes
-
Click Save.
-
The workflow diagrammer, appears with one state.
Select the state in the diagrammer and click the Edit icon on the State tab in the context panel.
-
In the Name field, enter Send Lost Lead Email.
-
Click Save.
-
To create the Send Email action:
-
Select the Send Lost Sale Email state in the diagrammer.
-
Click New Action on the State tab in the context panel.
-
Click Send Email in the New Action window.
-
Enter the following properties:
Section
Property
Value
Sender
Specific Sender
Select a sender.
Recipient
From Field
Record: Current Record
Field: Sales Rep
Content
Use Template
Select a template in the Template dropdown list.
-
Accept the default values for the other properties and click Save.
-
-
To create a Set Field Value action to set the value of the Lost Lead Email Sent field on the lead record to true:
-
Select the Send Lost Sale Email state in the diagrammer.
-
Click New Action on the State tab in the context panel.
-
Click Set Field Value in the New Action window.
-
In the Parameters section, select Lost Lead Email Sent in the Field dropdown list.
-
In the Value section, select Static Value and enable the Checked box.
-
Accept the default values for the other properties and click Save.
-
Every 30 minutes the saved search runs. If the saved search returns records that match the criteria, NetSuite initiates a workflow instance on each record. The records enter the Send Lost Sale Email state and the Send Email action and Set Field Value actions run. The next time the saved search is run, the saved search will filter out the leads that have the Lost Lead Email Sent field set to true.
For more information about how NetSuite runs scheduled workflows, see Scheduled Trigger.