Step 3 Create the Workflow and Set the Schedule
After you've completed Steps 1 and 2, 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.