I took on the challenged today to create a flow i have been thinking about the whole last year in 2019. I had a dream this morning and woke up with the solution in mind. Master Detail - roll up fields, isActive status and more. So I took a pen and paper and went to work and before I knew it the foundation was almost completed.
So after a few hours and 3 lives streams later, we finally came up with a simple solution in a series of developments for this 2020 Salesforce Project. Phase 1 design custom objects to hold:
You can see it in more detail on the video below. We then edited the Page Layout and created a Dependent Picklist with the Type and SubType items and added all the selections for each Subtype options. Its a beautiful thing.
Now for the fun part, we got to create a Flow, we created a screen that looks up the location, we set the variables and using the screen options we assign it to the single record. We also use the screen dependent picklist and set the Object API, the Primary Field API and the dependent field API storing the value to variables that get assigned along with other preset values to the Single record.
We than set a decision for single record creation or multiple records, after that we set the count variable and assign a subtract formula to count down until 0 and a decision that will continue until it reaches 0 assigning each single record adding it into the record collection then creating multiple records at once. We test with a screen Text display to show the countdown and finally a text display showing the created record ID's. Its a beautiful thing.
We finish it up by adding the Lightning Flow into the Inventory Location Record Page right above the activity component. Now we test it and it works as planned. We still have a few things to add such as option to select the donor and source but that is a matter of mapping some fields.
Our next phase is to add some automation to a custom self registration object profile page where participants can request assistance and provide a way to reserve items for qualified participants to RSVP and receive assistance affecting the availability of inventory items using process builder and flow.