How to duplicate multiple objects into an entity without touching the ones in the database?

Hi, I have the following issue.  Currently, I have a Checklist entity that users can go through. This checklist contains “control points” that have been made, which contains an enum. (good, bad, does not apply). What I want to achieve, is that everytime the user creates a “checklist” entity, the currently in database “control points” get added to this checklist.  This works fine until I create a new checklist. Then it removes the previously added control points and puts them into the newly added one. I get that this happens because of the association that gets changed. But I have no idea how to create the microflow so that it keeps the currently “in database” control points, but adds them to the new checklist so I can edit them there instead of editing the ones in the database. I'm using the following microflow to create a new checklist:   Anybody got a clue?  
1 answers

Hi Kenny,

               If you want to associate the Controlpoint list to each checklist, instead of looping the Controlpoint list, Create one new CheckList entity object. In this object, you can map the ControlPoint list in this association “CheckList_ControlPoint = $ControlPointList “and then commit in the object itself, or you can commit through commit object activity. 


Edited :

           Hi Kenny, For your reference, I have created the sample CheckList application with your same domain model. 


Step: 1  Create overview and Edit pages for two entities. By right-clicking on the entity, Select Generate Overview pages option and mention entities with Proper layout. 


Step 2 : Create one new page for CheckList. Like this



Step  3: After clicking on the Add button, it will call the microflow. In this microflow, we need to create a ControlPoint entity object. Then, map the CheckList input parameter in ControlPoint_CheckList = $CheckList association like this.


Step 4: Once the Control Point object creation is done, we need to add the show page activity to display the ContolPoint_NewEdit page. On this page, we can set the Name and Status for this control point. 



Step 5: After clicking on the Save button, we need to commit the ControlPoint object and add the Close page activity to close the currently opened popup layout page. Then click on the CheckList data view Save button to Commit the changes in the database.


Step 6 : By clicking on the View CheckList button, we can view the selected check list associated Control Points and we can able to edit the ControlPoint list in future. Added the listen to widget option, which will help to pass the selected ControlPoint object from list view to Edit button microflow data view as an input parameter. You can edit and commit those changes as well. 





I hope you, it will help you. If this solves your problem, you can mark this answer as accepted.


Thanks and regards,

Vijayabharathi V