Test a Flow
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.
- Log in to the NTO org’s Sales Cloud and navigate to the Opportunities tab.
- 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
- Opportunity Name:
- Populate the opportunity with the following products and quantities, and then click Save.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.