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.
- 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. - Log in to the NTO org’s Sales Cloud.
- From the App Launcher, enter
Products
and select Products. - 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
- Product Name:
- Click Related and click Add Standard Price.
- In the List Price field, enter
995.99
and click Save. - 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.
- 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.
- Click the Accounting subtab. Note the tax schedule is S1.
- 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.
- Click the Manufacturing subtab. Note the inventory item SP101 appears as a component of this assembly item in the Components sublist.
- 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.
- 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.
- In the Sync Salesforce Products to NetSuite Inventory and Assembly Items flow, click Test again.
- 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
- Product Name:
- Click Related, click the down arrow next to Standard Price Book, and then click Edit.
- In the List Price field, enter
1199.99
and click Save. - 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.
- 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.
- 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.
- Click the Manufacturing subtab. Note the inventory item SP101 appears as a component of this assembly item in the Components sublist.
- 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.
- 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.