Skip to main content

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 products in Salesforce with inventory and assembly items 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 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 a product is created or updated in Sales Cloud, it triggers the flow. First, be prepared to create a new test product in Sales Cloud. 

Next, if a corresponding inventory item doesn’t exist in NetSuite, prepare to verify the following.

  • A new inventory item containing relevant product details, including its associated product ID, is created in NetSuite.
  • The product is updated with its associated inventory item’s internal ID in Sales Cloud.

If a corresponding inventory item exists in NetSuite, prepare to verify the inventory item is updated with relevant product details in NetSuite.

Finally, prepare to verify an assembly item containing its associated inventory item with relevant product and inventory item details is created in NetSuite.

Test a Flow

Follow these steps to test a flow.

  1. In the Sync Salesforce Products to NetSuite Inventory and Assembly Items 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
  2. Log in to the NTO org’s Sales Cloud.
  3. From the App Launcher, enter Products and select Products.
  4. Click New, create a new product with the following values, and then click Save.
    • Product Name: Premium Solar Panel
    • Product Code: SP101
    • Product Description: Best Solar Panel Available
  5. Click Related and click Add Standard Price.
  6. In the List Price field, enter 995.99 and click Save.
  7. Go back to your flow and wait for the test to complete. If all the steps of the flow except step 7 show a green check mark, this indicates the flow ran successfully. This is because the List of Inventory Items condition in the If branch of the If/Else block evaluates to true, indicating the product doesn’t have a corresponding inventory item in NetSuite. So step 7 of the flow in the Else branch wasn’t executed. 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 3Tested flow showing a green check mark on step 4 within For Each block.Tested flow showing a green check mark on step 5 within If branch of If/Else block.Tested flow showing rest of step 5 within If branch of If/Else block.Tested flow showing a green check mark on step 6 in If branch.Tested flow showing Else branch of If/Else block and no green check mark on step 7 in Else branch.Tested flow showing a green check mark on step 8.Tested flow showing a green check mark on step 9.Tested flow showing more fields of step 9.Tested flow showing remaining fields of step 9.
  8. In NetSuite, search for Premium Solar Panel and select the corresponding inventory item. Verify the inventory item matches the Salesforce product and contains all relevant product details, including a Salesforce product ID. In this example, it’s 01t1U000006d7kkQAA, which is the ID of the Salesforce product. Note the subsidiary is Honeycomb Mfg.
    Premium Solar Panel showing Salesforce product ID and subsidiary.
  9. Click the Accounting subtab. Note the tax schedule is S1.
    Accounting subtab with tax schedule.
  10. Again, search for Premium Solar Panel and select the corresponding assembly item. Verify the assembly item has the same subsidiary as the inventory item, which is Honeycomb Mfg.
    Assembly/Bill of Materials form showing Honeycomb Mfg subsidiary.
  11. Click the Manufacturing subtab. Note the inventory item SP101 appears as a component of this assembly item in the Components sublist.
    Manufacturing subtab showing SP101 in Components sublist.
  12. Click the Sales/Pricing subtab. Note the inventory item’s list price of $995.99 appears in the USA dollar sublist. NetSuite calculates the other discount prices automatically.
    Sales/Pricing subtab with list price $995.99 in USA dollar sublist.
  13. In the NTO org’s Sales Cloud, verify that the product has been updated with the NetSuite item ID. In this example, it’s 389827, which is the internal ID of the NetSuite inventory item.
    Salesforce product with 389827 as NetSuite item ID.
  14. In the Sync Salesforce Products to NetSuite Inventory and Assembly Items flow, click Test again.
  15. In the NTO org’s Sales Cloud, edit the Premium Solar Panel product with the following values, and then click Save.
    • Product Name: Premium Solar Panel - upgraded
    • Product Description: Best Solar Panel Available - upgraded
  16. Click Related, click the down arrow next to Standard Price Book, and then click Edit.
  17. In the List Price field, enter 1199.99 and click Save.
  18. Go back to your flow and wait for the test to complete. If all the steps of the flow except steps 5 and 6 show a green check mark, this indicates the flow ran successfully. This is because the List of Inventory Items condition in the If branch of the If/Else block evaluates to false, indicating the product has a corresponding inventory item in NetSuite. So steps 5 and 6 of the flow weren’t executed.
    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 a green check mark on step 4 within For Each block.Tested flow showing If/Else block and no green check mark on step 5 within If branch.Tested flow showing rest of step 5 within If branch of If/Else block.Tested flow showing no green check mark on step 6 in If branch.Tested flow showing Else branch of If/Else block and a green check mark on step 7 in Else branch.Tested flow showing a green check mark on step 8.Tested flow showing a green check mark on step 9.Tested flow showing more fields of step 9.Tested flow showing remaining fields of step 9.
  19. In NetSuite, search for Premium Solar Panel - upgraded and select the corresponding inventory item. Verify the display name and purchase description of the inventory item have been updated.
    Inventory Item form with Premium Solar Panel - upgraded and associated field values.
  20. Again, search for Premium Solar Panel - upgraded and select the corresponding assembly item. Verify the display name and description of the assembly item are associated with the updated product.
    Assembly/Bill of Materials form with Premium Solar Panel - upgraded and associated field values.
  21. Click the Manufacturing subtab. Note the inventory item SP101 appears as a component of this assembly item in the Components sublist.
    Manufacturing subtab with SP101 in Components sublist.
  22. Click the Sales/Pricing subtab. Note the inventory item’s list price of $1199.99 appears in the USA dollar sublist. NetSuite calculates the other discount prices automatically.
    Sales/Pricing subtab with list price $1199.99 in USA dollar sublist.
  23. Repeat steps 1 through 22 to test another product 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.

Keep learning for
free!
Sign up for an account to continue.
What’s in it for you?
  • Get personalized recommendations for your career goals
  • Practice your skills with hands-on challenges and quizzes
  • Track and share your progress with employers
  • Connect to mentorship and career opportunities