
Announcements
Hi,
I have a simple data entry powerapp that is connected to some entities: 1. Orders > 1:N > 2. Groups > 1:N > 3. Products & 4. Decorations
When a user in my app creates an Order, they will be manually entering details through a form control to create a Group. That Group can contain many Products and Decorations and those are also entered through separate forms and are patched to the related parent Group.
These entities are all displayed in their own galleries, so when a user wants to delete a Group, they will select the item and an icon will delete the record and all related records.
To speed up the process of entering data in the forms, I'd like to allow the user to "clone" their selected Group and all related Product and Decoration records. What this should functionally do is create a another record for all the same items but give them a new unique record id. This way, instead of entering everything all over again, if there are only minor changes they would just do small edits instead.
Question: In the above scenario, what is the best practise for creating a control (button) that can clone a parent record and related records? I'm imagining it could include a ForAll or Patch function but just curious about other optimized ways of writing the formula.
Any help is greatly appreciated!
Hi @virakones,
I don't think there's a best practice in general and or one "does-it-all" operation in canvas apps. Since you're using entities and a CDS backend you can use server-side logic to perform the cloning with the help of some tools/helpers such as https://github.com/demianrasko/Dynamics-365-Workflow-Tools You can leverage this and with no code perform a clone of your record. This way from your app it's just one REST api call with a custom action to CDS to perform the whole cloning, which simplifies your app's code drastically and have re-usable cloning logic for other scenarios.
Hope this help!