上QQ阅读APP看书,第一时间看更新
Testing the workflow
To test our flow, we have a couple of ways to start it (as we learned in Chapter 1, Salesforce Fundamentals). We'll put a flow component on our home page so that we can quickly create new movie records straight from our home page:
- Navigate to our BIM DB app, and, on the home page, click the wheel icon and select Edit Page. In the App Builder, remove all the components from the page, so you have a clean canvas.
- Drag a flow component (from the standard components side menu) into the top section of the page. On the right-hand side, a sidebar will appear in which you can set flow attributes.
- As flow, select our FastCreateMovieWizard flow and choose the One Column layout (our flow screen elements are not ordered properly to use the two-column layout).
- Now that we are adjusting our home page, drag two List View components in the right section of the page. Set the Attributes for the first list view to Object = Movie, Filter = All, Records To Show = 5, and check the Enable Inline Edit checkbox. For the second list view, set Object = Person, Filter = All, Records To Show = 5, and check the Enable Inline Edit checkbox.
- Now, click the Activate button in the top-right corner (assign as org default) and then click Save and then Back. You should now see this as your home page:
- To test your flow, fill in all the fields with movie details (you can find movie details at www.imdb.com) and, as the director's full name, specify a name for which you know there isn't a record in our database yet.
- After you have clicked the Next button, a second screen will appear asking for the director's biography and birthdate. Then, hit Finish. Check out the new movie record you just created and it's director lookup (which should correctly be related to a new Person record you just created).
- On the Related tab of the movie, you should also see a new review. When you open that review in the related Approval History list, you should also see that our Process Builder submitted your review automatically for approval.
- As a second test, fill in new details of another movie, but from the same director. This time, you shouldn't receive a second step asking for director's details (as this director already exists in the database). Your flow should have immediately created the new movie, linked to the same director, and also have a review that is awaiting approval.
I know there were a lot of steps to follow, but what kind of amazing things will you be able to create to make processes easier for your users?
You did a great job and, as a Salesforce Platform Developer, it's super important to understand and leverage all the declarative tools and features provide by Salesforce.