Personalized Community is here!
Quickly customize your community to find the content you seek.
Check out the latest Sales updates!Learn about the key capabilities and features of Dynamics 365 Sales and experience some of the new features.
Download overview guide | Watch Sales video
2021 Release Wave 1Discover the latest updates and new features to Dynamics 365 planned April 2021 through September 2021.
Release overview guides and videos Release Plan | Preview 2021 Release Wave 1 Timeline
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Program | Finance and Operations TechTalks | Customer Engagement TechTalks | Upcoming TechTalks | All TechTalks
It’s been a while since my last blog. Life took over, but I now finally got round to it. I want to share my experience with the OnDataRefresh property of the Embedded Canvas App. I will continue with my previous example of replacing a dialog with embedded canvas app.
First things first, let me start by apologizing. I gave you wrong advice in part 1. If you want to use the OnDataRefresh property you need to use a “single line of text” field which is required, rather than creating a new field which I proposed first
The documentation is clear on the matter, albeit slightly out of the way. The first time using the OnDataRefresh I overlooked this. And I am not ashamed to admit it costs me a couple hours to find out.
When adding an embedded canvas app to a model-driven form always use a required field that is guaranteed to have a value. If your field does not have a value your embedded canvas app will not refresh in response to any change in data on the host model-driven form.
To show the OnDataRefresh property in action I setup default values on the “Perform Creditcheck” screen. Primarily I set the default for the subject field to:
Secondly, the default value for due date is:
Then I set the default for the priority I to:
Finally in the description, the default value is:
As you can see I insert the title from the case by using the ModelDrivenFormIntegration as this is a perfect example to show you how the OnDataRefresh property is behaving. I want the default values to update whenever I update the title of the case.
I was very surprised to see the OnDataRefresh property worked out of the box. I had setup the default values and started exploring the code needed to update the default values whenever the title changes. But to my surprise the default value already changes without doing anything! See the clip below to see this in action.
A small piece of functionality makes this happen inside the Canvas app. On the ModelDrivenFormIntegration object you can find the property OnDataRefresh. By default this already is set to refresh the data source of the host of your app.
If you pay close attention to the clip you also see a unwanted side-effect. I changed the description on purpose to show that the OnDataRefresh property, in combination with the default value, resets the value of the description field. Of course I do not want this because imagine you write a long description and then decide to change the title, you would lose all your text!
Luckily I have the solution! We can stop the OnDataRefresh from updating the description field in 5 simple steps:
Check out the video below to see the end result.
I love Embedded Canvas Apps. Certainly the ease with which you can make an impact on the model-app form is incredible. Also the integration is seamless, everything you would want is made available by the PowerApps team. This OnDataRefresh property of Embedded Canvas App emphasizes this.
I highly recommend using Embedded Canvas Apps in any implementation. The users will be thankful for it. I am very curious to hear your thoughts on the matter, do you like it as much as I do? Feel free to connect and ask questions, I’d love to help!
The post Embedded Canvas App – Exploring the OnDataRefresh property appeared first on Power Addict Ben.
Business Applications communities