A business has a data model in which an Account can have multiple related Financial Records. Cases can also be related to Financial Records using a junction object to support a many-to-many relationship. A user should be able to utilize a screen flow embedded on a Case record page to select from the Account’s related Financial Records. A Case Financial Record should then be created for each of the selected records in the data table. The entity relationship for this data model is outlined below:
We can use a screen Flow with a Data Table component to display the Case’s Account’s related Financial Records, allowing the user to choose which records to relate to the current Case. The screen Flow can be embedded directly on the Case record page to allow for ease of use.
As a best practice, be sure to build and test Flows in a Sandbox before deploying to a Production environment.
Step 4: Add a Get Records Element to the Canvas - we will configure this to find Financial Records for the Case’s related Account
Step 5: Add a Decision Element to the Canvas - we will use this to determine if any Financial Records were found related to the Cases' Account
Step 6: Add a Screen Element for the Default Outcome path - we will display a message letting the user know that the Account has no related Financial Records (If you wish to add more logic here, such as giving the user the ability to add Financial Records, this could be configured, but will not be covered in this tutorial)
Optional: customize this path further to add additional functionality - for this example, the Flow will be set to End if this path is taken
Step 7: Add a Screen Element for the Decision Path which found related Financial Records - we will use this screen to display those records in a Data Table and allow the user to select which records to associated with the Case
Step 8: Add a Loop Element to the Canvas. Give the Element a Label and Description. This Element will loop through each of the records selected by the user in the Data Table
Step 9: Add an Assignment Element to the Canvas - this will be used to assign values for the Case Financial Records (the junction object) to create for each of the selected Financial Records
Step 10: Add another Assignment Element to the canvas - this will be used to add the previously assigned Case Financial Record values to a collection - provide a Label and Description
Step 11: Outside of the Loop, add a Create Records Element - select to create multiple records and select {!var_CaseFinancialRecordCollection} as the records to create (as a best practice, a Fault Path should also be specified in the event the Create Element fails - this is not covered in this tutorial)
Step 12: Add a final Screen Element to serve as confirmation that the records were created successfully.
Step 13: Review, Debug, and Test the Flow results - the completed Flow may look something like this
Step 14: Activate the Flow and Embed it on a Case record page. To embed the Flow on a Case record page, navigate to a Case record, and select Edit Page from the Setup icon dropdown menu.
Notes:
_____________________________________________
Written by: Zack Terry | Salesforce Answers Leader
Zack Terry is a Senior Salesforce Solution Architect at Fast Slow Motion, which aims to be a blessing to business leaders by helping them implement and maximize their use of the Salesforce platform. At the time of writing, Zack has worked in the Salesforce ecosystem for nearly a decade, holds 20 Salesforce Credentials, and has achieved the rank of “All-Star Ranger” on Trailhead. He regularly participates as an Answers Leader in the Salesforce Trailblazer Community.
Submissions reflect only the opinions of the user who made available the Submission and not the opinions of Salesforce, regardless of whether the user is affiliated with Salesforce, and may contain or constitute products, services, information, data, content and other materials made available by or on behalf of third parties ("Third Party Materials). Salesforce neither controls nor endorses, nor is Salesforce responsible for, any Third Party Materials, including their accuracy, validity, timeliness, completeness, reliability, integrity, quality, legality, usefulness or safety, or any applicable intellectual property rights. Any Submissions made available through any message board or forum in response to posted questions, or that otherwise purports to answer any questions, including any questions about Salesforce or Programs, are made available for your general knowledge only and should never be relied upon as answers to your specific questions (even if an answer is marked as a “best” answer or with any similar qualifications). You should always contact Salesforce support for answers to your specific questions. Salesforce has no control over Submissions, and is not responsible for any use or misuse (including any distribution) by any third party of Submissions.
If you have questions, tap into the wisdom of our entire Trailblazer Community here: https://trailhead.salesforce.com/trailblazer-community/feed
000925354

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.