Skip to main content
Build the future with Agentforce at TDX in San Francisco or on Salesforce+ on March 5–6. Register now.

Test a Flow

Learning Objectives

After completing this unit, you’ll be able to:

  • Prepare to test a flow.
  • Test your flow to ensure it syncs new or updated closed-won opportunities in Salesforce with sales orders in NetSuite as expected.

Prepare to Test a Flow

After you’ve designed your flow, you must test it from end to end to ensure it syncs data as expected.

As a best practice, test your flow using your test systems and data. After you complete testing, run the flow using your production systems and data. For Salesforce, this means using a sandbox org to test your flow and a production org to run your flow.

Also, as a best practice, test every possible path of your flow. For example, if your flow has an If branch and an Else branch in an If/Else block, ensure to test both branches.

In general, you have up to 10 minutes to complete a test. When the test completes or 10 minutes have passed, the test stops. As a best practice, you should get all required applications and data ready for the test before starting it.

In this use case, when an opportunity is created or updated and marked as closed won in Sales Cloud, it triggers the flow. First, prepare to create or update a test opportunity and mark it as closed won in Sales Cloud.

Next, prepare to verify the following.

  • A sales order with all the opportunity products is created in NetSuite.
  • The opportunity is updated with the sales order’s internal ID in Sales Cloud.

Test a Flow

Follow these steps to test a flow.

  1. Log in to the NTO org’s Sales Cloud and navigate to the Opportunities tab.
  2. Create an opportunity with the following values, and then click Save.
    • Opportunity Name: Burlington Textiles - Phone Purchase
    • Account Name: Burlington Textiles Corp of America
    • Close Date: today’s date
    • Stage: Proposal/Price Quote
  3. Populate the opportunity with the following products and quantities, and then click Save.
    Four opportunity products with associated quantities and sales prices.
  4. In the Sync Salesforce Opportunities to NetSuite Sales Orders flow, click Test. The flow goes into a read-only mode.
    Note: While the test is running, if you want to stop it, click Stop Test.
  5. In the NTO org’s Sales Cloud, access the opportunity Burlington Textiles - Phone Purchase, click Closed, select Closed Stage, select Closed Won from the Stage picklist, and then click Save.
  6. Go back to your flow and wait for the test to complete. If every step of the flow shows a green check mark, this indicates the flow ran successfully. Take a look at the Test Output section and see the record values you entered for the test.
    Tested flow showing a green check mark on step 1.Tested flow showing a green check mark on step 2.Tested flow showing a green check mark on step 3.Tested flow showing For Each block to loop over list of accounts.Tested flow showing a green check mark on step 4 within For Each block.Tested flow showing the rest of step 4 within For Each block.Tested flow showing a green check mark on step 5 within For Each block.
  7. Access the Burlington Textiles Corp of America customer in NetSuite, scroll down and click the Sales parent subtab, and then click the Transactions child subtab. Verify that a sales order is created. In this case, the sales order is SLS00001378.
    NetSuite customer with address and phone information.NetSuite customer’s sales order for associated Salesforce opportunity.
  8. Click Edit on the sales order, and then click the Items subtab. Verify the sales order’s total amount and line items in NetSuite match the associated opportunity’s amount and products in Salesforce.
    Sales order with total amount in NetSuite.Sales order with line items in NetSuite.
  9. In the NTO org’s Sales Cloud, verify that the opportunity is updated with the NetSuite order ID. In this case, the NetSuite order ID is 185336.
    Salesforce opportunity showing NetSuite order ID.
  10. Repeat steps 1 through 9 to test another opportunity of your choice. Your flow should work as expected.

Good job! In the next unit, you learn how to activate, monitor, and troubleshoot your flow in the production environment.

Share your Trailhead feedback over on Salesforce Help.

We'd love to hear about your experience with Trailhead - you can now access the new feedback form anytime from the Salesforce Help site.

Learn More Continue to Share Feedback