How to Create a NetSuite Workflow Using a Saved Search Condition

by Matthew Esserman in , January 25th, 2023

This blog gives you step-by-step instructions on how to create a NetSuite Workflow. Our example Workflow utilizes a Saved Search condition. This particular Workflow assigns a task (due in 5 days) to the sales rep on the corresponding customer record. The assigned task is to follow up with the customer because their Master Service Agreement (MSA) is expiring in one week.

Our particular workflow demonstration utilizes the custom field feature in NetSuite. For more info on how to create custom fields please refer to the SuiteAnswers article titled: "Creating a Custom Field" (Answer Id: 10078).

1) Log in to your NetSuite Administrator Role and go to Reports > Saved Searches > All Saved Searches > Select New

new saved search

2) In the New Saved Search list select "Customer"

select customer

3) Type in your desired search title such as "Customer won status"

4) Under Criteria > Filter > Select "Status" > Select "Customer-Closed Won" > click "Set"

5) Under Criteria > Filter > Select ***"MSA expiration (Custom)"> "on" "same day next week" > click "Set"

6) Under Criteria > Filter > Select ***"MSA Signed (Custom)" > Select "Yes" > click "Set"

***Note: "MSA expiration" and "MSA signed" are two custom fields created for our customer record. For more info on how to create custom fields please refer to the SuiteAnswers article titled: "Creating a Custom Field" (Answer Id: 10078).

At this point, your Saved Search form should look like the image below

Criteria

7) Under Results > Select "Sales Rep" > Click "Add"

8) Under Results > Select "Status" > Click "Add"

9) Under Results > Select "MSA Expiration (Custom)" > Click "Add"

10) Under Results > Select "MSA Signed (Custom)" > Click "Add"

At this point, your Saved Search form should look like the image below. The fields you add here will be the columns you see when you view your saved search. So, add the fields you want to see in your saved search results.

Results

11) Click "Save & Run" in the top left corner to test that your saved search is working correctly.

save & run saved search

The Saved Search Runs and finds three customers matching our criteria. It should display all the customers that match all the criteria you filtered (i. customer closed-won status, ii. MSA expires one week from today, and iii. MSA is signed). In others words, after you click "Save & Run" it will generate a list of all customers that have customer-closed won status, MSA expiring in one week, and MSA signed.

saved search test run results

If your Saved Search is working properly, then you are ready to move on to Step 2.

Step 2: Create the Workflow

1) Go to the Customization tab > Workflow > Workflows > Select "New"

New Workflow

2) In the Name field type your desired name such as "Customer follow up"

3) In the ID field type your desired ID such as "_customer_follow_up"

Tip: We often prefer to put an underscore in the ID fields manually because NetSuite automatically will put a prefix to the internal ID and this makes it easier for developers to insert and read during their development.

4) For Record Type > Select "Customer" and for sub types > select "Customer"

5) For Description type an optional description of the workflow such as "This Workflow assigns a task (due in 5 days) to the sales rep to follow up with a customer that has a Master Service Agreement expiring in exactly one week."

6) For now set release status to "Testing" and keep instance and history as "only when testing"

7) Check the box for "enable logging"

workflow boxes 1

8) For Initiation we will select "scheduled" to set the workflow to run automatically every night at midnight.

9) For Saved Search Filter select your saved search filter (customer-won status).

10) Check Repeat box (if not already checked).

11) Set Frequency to "daily"

12) Scheduled from date select today's date

13) Set Execution time to 12:00am

workflow boxes 2

14) Click "Save"

workflow click save

At this point your workflow should look like the image below

Workflow 1

1) Click on the grey box titled "State 1"

2) Click on "+ new action" in the bottom right corner (pictured below)

+ New Action

3) Select "Create Record"

select create record

4) Under Parameters > Record Type > Select "Task"

5) Under Field > Select Title > In the Text field type tour task title such as "Follow Up with Customer (MSA Expiring in 7 days) > Click Add

6) Under Field > Select "Due Date" > for date select "five days from now" > Click Add

7) Under Field > Select "Assigned" > for Formula type in "{salesrep.id}" > Click Add

8) Under Field > Select "Company" > for selection select "current record"> for join select "company" > Click Add

parameters

9) Select your saved search condition, "customer won status"

select saved search condition

At this point your workflow action should look like the image below

workflow action
parameters

9) Go ahead and click that "Save" button. Now we are ready to test the workflow!

Step 3: Test the Workflow

1) In the Workflow Edit mode click the pencil icon (indicated in the picture below)

workflow testing 1

2) Click "Execute Now" to test run your Workflow

workflow testing 2

3) Go to the Activities tab > Scheduling > Select Tasks

Select Tasks

4) Here you will be able to see if the workflow assigned a task when we clicked "Execute Now". Click View on the task.

view task

5)In the Task record click on the "Related Records" subtab to see the company that the sales rep needs to follow up with.

related records

6) In the Task record click on the "System Information" subtab to view the system notes. Here you should see that your workflow created the task.

task system notes

Conclusion

That's it for our NetSuite Workflow tutorial! We hope you found this helpful and that you're now able to use workflows to your advantage in managing your business processes. If you have any questions or feedback, please reach out to us in the comments below or contact us at Anchor Group. Thanks for reading! 


Request a free book on SuiteCommerce

suitecommerce book

Make sure to request a free copy of our SuiteCommerce book and we will ship you a paperback version!

 
 

Want to keep learning?

Our team of NetSuite professionals has written articles on a wide variety of NetSuite topics, from SuiteCommerce tips, to recommended NetSuite solutions, to available support services, and more! 

Your cart