I am creating a model driven app. I want to automatically create records that are related to related entities when creating another record. An example will follow.
Info
I have the following tables in my dataverse environment:
- Sessions
- Products
- Inspection Sets
- Samples
Relationships:
Inspection Set to Sessions 1:N
Inspection Set to Products 1:N
Product to Samples to 1:N
Session to Samples 1:N
An Inspection set contains a number of products. Many inspection sets and products exist currently in the dataverse environment. Now I want to create a session for an inspection set. When creating a session I also need to create its samples. These samples should be related to the products in the inspection set.
Example
So if my inspection set (called InsSet) has two products (prod1, prod2) and I want to create a new session for InsSet, than I also want to create two samples (sam1, sam2), such that sam1 is related to prod1 and sam2 is related to prod2. Is there a way to this in model driven apps?
Possible solutions
I thought of using a cloud flow to create related records, but I don't know if I can create multiple records that are related to related records of a session.
Should I maybe use a business flow for this?