Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics 365 | Integration, Dataverse...
Unanswered

Updating Parent Relation when creating a new Child record

(0) ShareShare
ReportReport
Posted on by 5

There are two entities which are Client Notes and Client Engagement on CDS and there N to 1 relationship between them. We’ve created a Canvas app which lists the Client Notes linked to Client Engagement on Dynamics. Also you can create a new Note record linked to selected Client Engagement record on Dynamics.

We made that relation and calling the Page created by Canvas App with the code below. The code is written on onload of the Client Engagement form.

 pastedimage1668680492534v1.png

 

We feed the Client Engagement ID to Canvas App with recordID parameter. This parameter is set to Var1 onStart of App.

            Set(Var1,Param("recordId"));

Whenever a new Note record is created, it is linked to parent Client Engagement record with the DataCard on Canvas app. This Datacard combobox is on the new Note form.

Default property of Combobox Datacard is:

If(IsBlank(ThisItem.'Client Engagement'),

LookUp('Client Engagement',Advice=GUID(Var1)),

ThisItem.'Client Engagement')

We’re having performance issue on Canvas app , it happens on different areas, it sometime happens when saving the data , sometimes deleting the data, sometimes going back to main screen, etc..

I’ve monitored the app and seen that DataCard which is for parent Client Engagement fetching all data first and this is really big data in the system. When I get rid of Datacard combobox from Form, performance is back to normal.

I want to find a way to link the new Note record with Parent Client Engagement record without using Datacard.

I used PATCH function onSelect event of Save Button on New Record create form like below:

 

If(!IsBlank(Filter('Client Notes', 'Client Engagement'.Advice=GUID(Var1))),

SubmitForm(Form2),(

Patch('Client Notes',

      Defaults('Client Notes'),

      {   Name: DataCardValue5.Value,

          'Note Type': DataCardValue2.Selected.Value,

          'Note Text': DataCardValue3.Value,

          'Client Engagement':LookUp('Client Engagement',Advice=GUID(Var1))

      }

)));

 

If I switch from Gallery view of Notes to New Note Create Form, I’m not able to get Parent record’s ID while using patch and updating record. Hence newly created Notes are not linked to any parent Client Engagement. How can I get parent record ID when I am creating a new child record?

Or Could you advise something to improve performance even if I use Datacard for parent record relation? I read articles about how to improve performance of canvas app and applied some changes, made good progress but still it is not acceptable level.

Thanks in advance for all your response,

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,711 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,458 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans