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 updated inventory items in NetSuite with products and associated price book entries in Salesforce 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 flows using your test systems and data. After you’re done with testing, run the flows using your production systems and data. For Salesforce, this means using a sandbox org to test your flows and a production org to run your flows.
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 inventory item is updated in NetSuite, it triggers the flow. First, be prepared to update an inventory item in NetSuite.
Next, if a corresponding product doesn’t exist in Sales Cloud, prepare to verify the following.
- A product containing relevant inventory item details, including the inventory item’s internal ID, is created in Sales Cloud.
- The inventory item is updated with its associated product ID in NetSuite.
- A price book entry associated with the product is created in Sales Cloud.
Finally, if a corresponding product exists in Sales Cloud, prepare to verify the following.
- The product is updated with relevant inventory item details in Sales Cloud.
- The price book entry associated with the product is updated in Sales Cloud.
Test a Flow
Follow these steps to test a flow.
- In the Sync NetSuite Inventory Items to Salesforce Products and Price Book Entries flow, click Test. The flow goes into a read-only mode.
Note: While the test is running, if for some reason you want to stop it, click Stop Test. - Log in to NetSuite using your username and password.
- In the Search field, enter
Mobile Station Desk
and select the DES00002 Mobile Station Desk Steel/Wood - Beach inventory item that appears.
Note: If you don’t have this item in your NetSuite instance, use any existing inventory item of your choice. - Click Edit.
- Update the following values of this inventory item. Notice by default the item’s internal ID is 127, and its Salesforce product ID is blank.
- Display name:
Mobile Station Desk Steel/Wood - Sandy Beach
- Purchase price:
99.99
- Purchase description:
Mobile Station Desk Steel/Wood - Sandy Beach
- Display name:
- Click Save to create the inventory item.
- Go back to your flow and wait for the test to complete. If steps 1 through 5 of the flow show a green check mark, this indicates the flow ran successfully. The List of Product condition in the If branch of the If/Else block evaluates to true. This indicates the updated inventory item doesn’t have a corresponding product in Sales Cloud, so the steps in the Else branch of the flow weren’t executed. Take a look at the Test Output section and see the record values you entered for the test.
- Log in to your NTO org using your username and password.
- From the App Launcher, enter
Products
and select Products. - View all products. Verify the Mobile Station Desk Steel/Wood - Sandy Beach product matching the updated NetSuite inventory item has been created.
- Click Mobile Station Desk Steel/Wood - Sandy Beach. Verify the product also has a NetSuite item ID. In this example, it’s 127, which is the internal ID of the NetSuite inventory item.
- Click Related, click the down arrow associated with the Standard Price Book, and then click View. Verify a price book entry shows the list price $99.99 for the product in the Standard Price Book.
- Access your inventory item in NetSuite and verify the inventory item has been updated with a Salesforce product ID. In this example, it’s 01t1U000006dXOVQA2, which is the ID of the Sales Cloud product.
- In the Sync NetSuite Inventory Items to Salesforce Products and Price Book Entries flow, click Test again.
- In NetSuite, update the following values of the inventory item.
- Display name:
Mobile Station Desk Steel/Wood - Pebble Beach
- Purchase price:
189.99
- Purchase description:
Mobile Station Desk Steel/Wood - Pebble Beach
- Display name:
- Click Save to create the inventory item.
- Go back to your flow and wait for the test to complete. If steps 1, 2, 6, 7, and 8 of the flow show a green check mark, this indicates the flow ran successfully. The List of Product condition in the If branch of the If/Else block evaluates to false. This indicates the updated inventory item has a corresponding product in Sales Cloud, so steps 3 through 5 in the If branch of the flow weren’t executed.
- In the NTO org’s Sales Cloud, verify the existing product matching the updated NetSuite inventory item has been updated. Notice its product name is Mobile Station Desk Steel/Wood - Pebble Beach.
- Click Mobile Station Desk Steel/Wood - Pebble Beach.
- Click Related, click the down arrow associated with the Standard Price Book, and then click View. Verify the price book entry shows the list price $189.99 for the product in the Standard Price Book.
- Repeat steps 1 through 20 to test another inventory item 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.