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.
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,