Hello everyone,
I have an application contains on two entities ... what I need to do is when some conditions have done automatically create a new record in the another entity and take some data from the original entity ... is there any way to do it?
hope I explained the issue well .. thanks in advance
yes, that what I did ... Thanks
great to hear @MohammedWard .
@jlindstrom Thanks very much it's working
Thanks Drrickryp but as @jlindstrom said I want a solution from model-driven 🥀
Of course you are right. I overlooked the model driven reference.
@Drrickryp your solution is awesome but I think the question is regarding model driven apps.
There are two ways to do that in a model driven app @Drrickryp . Real time workflow or Power Automate.
for Power automate Flow:
create a solution
add a flow to the solution
choose common data service current environment connector
select for trigger when a record is created, updated, or deleted. set it to the entity 1 and choose the when a record is created option.
next step get records--get the record that triggered the flow. You want to do this because on create doesn't return all of the fields..
then add a create step choose entity 2 for the entity type, then map the desired fields.
populate the lookup for entity 1 on entity 2, but be sure you use the right format. https://crmtipoftheday.com/1311/use-entity-name-in-flow-lookups/
for real time workflow, you will need to click the gear and go to advanced settings-->processes.
Create a workflow and uncheck the run in background option.
Choose entity 1 as the entity type.
trigger to run on organization scope and run when record is created
I prefer flow, unless it needs to happen immediately. then use real time workflow. don't use background workflow, it will go away in the future.
@MohammedWard if this answers your question please mark it as a solution.
If you are using an edit form in entity1 (say named Form1) to input the original data you could use Patch() in the OnSuccess property of the form in entity1 to add some items from entity1 to entity2 by putting the following formula in the OnSuccess property of the edit form:
Patch(entity2, Defaults(entity2), {targetfield1:Form1.LastSubmit.aname, targetfield2:Form1.LastSubmit.address, etc.})
This patch would execute immediately on submission of Form1, creating a record in entity2 and putting data from a field from entity1 called aname into a field in entity2 called targetfield1 and data from a field called address in entity1 into targetfield2 of entity2 . It would be important to have the Patch in the OnSuccess property because you would not want it to execute unless the submission to entity1 was successful. Naturally, you would change the name of "targetfield1" and "targetfield2" to the actual names of the fields in entity2.
mmbr1606
22
Super User 2025 Season 1
stampcoin
19
Michael E. Gernaey
17
Super User 2025 Season 1