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 customers in NetSuite with accounts 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 a customer is created in NetSuite, it triggers the flow. First, be prepared to create a new customer in NetSuite with multiple addresses. Prepare to specify the billing and shipping addresses for the customer.

Remember your flow is designed to use one billing address and one shipping address from each NetSuite customer to populate the corresponding Salesforce account’s billing and shipping addresses. It doesn’t use any additional addresses from NetSuite customers to populate Salesforce accounts.

Next, if a corresponding account doesn’t exist in Sales Cloud, prepare to verify the following.

  • A new account containing relevant customer details, including the customer’s billing and shipping addresses and internal ID, is created in Sales Cloud.
  • The customer is updated with its associated account ID in NetSuite.

Finally, when a new customer is created in NetSuite and a corresponding account exists in Sales Cloud, prepare to verify the following.

  • A corresponding account isn’t created in Sales Cloud.
  • The customer isn’t updated with any account ID in NetSuite.

Test a Flow

Follow these steps to test a flow.

  1. In the Sync New NetSuite Customers to Salesforce Accounts 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 NetSuite using your username and password.
  3. Click Lists | Relationships | Customers | New.
  4. Populate the new customer with the following values.
    • Company Name: Cyberspace Sentinel
    • Web Address: https://www.cyberspacesentinel.com
    • Phone: +91 00402784422
    • Primary Subsidiary: first available value
  5. Scroll down and select the Address submenu, click Edit, enter the following values, and then click OK.
    • Address 1: IT Park
    • City: Madhapur
    • State: Telangana
    • Zip: 500081
    • Country: India
  6. Leave the Default Billing checkbox on this address selected, deselect the Default Shipping checkbox, and then click OK.
  7. Add another address with the following values, and then click OK. The Default Shipping check box is automatically selected.
    • Address 1: 7184 Tanna Salai
    • City: Bengaluru
    • State: Karnataka
    • Zip: 600002
    • Country: India
  8. Add another address of your choice.
  9. Click Save to create the customer.
  10. Go back to your flow and wait for the test to complete. If steps 1 through 4 for the first iteration of the flow show a green check mark, this indicates the flow ran successfully for the default billing address. 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 first If/Else block and For Each block.Tested flow showing second If/Else block within For Each block and a green check mark on step 3 within second If/Else block.Tested flow showing the rest of step 3 within the second If/Else block.Tested flow showing a green check mark on step 4 within the second If/Else block.Tested flow showing second If branch of second If/Else block.Tested flow showing no green check mark on step 5 in second If branch of second If/Else block.
  11. Go to the For Each block on the tested flow and select Iteration #2 from the Review Iterations picklist.
    Tested flow showing For Each block with three iterations.
  12. Scroll down and note that step 5 of the flow was also executed successfully. This indicates that a Salesforce account was created with the default billing address during the first iteration through the NetSuite customer’s addresses. Then the account was updated with the default shipping address during the second iteration through the addresses. Because the third address is neither billing nor shipping, it’s ignored during the third iteration.
    Tested flow showing second If branch of second If/Else block and a green check mark on step 5 of the flow within second If branch.Tested flow showing the rest of step 5 of the flow.
  13. Log in to the NTO org’s Sales Cloud, navigate to the Accounts tab, and view all accounts. Verify that a new account matching the NetSuite customer has been created. Notice that in the Billing Country field, India appears as _india. This is a NetSuite convention for its country data.
    Sales Cloud accounts showing the Cyberspace Sentinel account matching the NetSuite customer.
  14. Click Cyberspace Sentinel and then click Details. Verify that the account also has a shipping address and NetSuite customer ID. In this example, the NetSuite customer ID is 2142748, which is the internal ID of the NetSuite customer.
    Cyberspace Sentinel account showing the NetSuite customer ID.
  15. Access your customer in NetSuite and verify that the customer has been updated with a Salesforce account ID. In this example, it’s 0011U00002AvJfyQAF, which is the ID of the Sales Cloud account.
    Cyberspace Sentinel customer showing the Salesforce account ID.
  16. In the Sync New NetSuite Customers to Salesforce Accounts flow, click Test again.
  17. In NetSuite, click Edit on the Cyberspace Sentinel customer, click Actions | Delete, and then click OK to delete the customer.
  18. Repeat steps 3 through 9 to recreate the same customer.
  19. Go back to your flow and wait for the test to complete. If only the first two steps of the flow show a green check mark, this indicates the flow ran successfully. This is because the List of Account condition in the first If/Else block evaluates to false, indicating the new customer has a corresponding account in Sales Cloud. So the rest of the flow wasn’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 first If/Else block and For Each block.Tested flow showing second If/Else block within For Each block and step 3 within second If/Else block.Tested flow showing the rest of step 3 within the second If/Else block.Tested flow showing no green check mark on step 4 within the second If/Else block.Tested flow showing second If branch of second If/Else block.Tested flow showing no green check mark on step 5 in second If branch of second If/Else block.
  20. In the NTO org’s Sales Cloud, verify that no new account matching the NetSuite Cyberspace Sentinel customer has been created.
    Sales Cloud accounts showing no new Cyberspace Sentinel account matching the new NetSuite customer.
  21. Reload the Cyberspace Sentinel customer page in NetSuite and verify the customer has not been updated with a Salesforce account ID.
    Cyberspace Sentinel customer in NetSuite showing no Salesforce account ID.
  22. Repeat steps 1 through 21 to test another customer 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.

Condividi il tuo feedback su Trailhead dalla Guida di Salesforce.

Conoscere la tua esperienza su Trailhead è importante per noi. Ora puoi accedere al modulo per l'invio di feedback in qualsiasi momento dal sito della Guida di Salesforce.

Scopri di più Continua a condividere il tuo feedback