The Power Apps Maker Portal is where Microsoft is migrating the maker experience for model-driven Dynamics 365 apps from the classic Solution Explorer within Dynamics 365. Hopefully most people already know this, because it has so much to offer and will eventually be all that we have. We are slowly seeing Microsoft bring the Maker Portal into parity with the Solution Explorer. This reflects the merging of Dynamics 365 apps and model-driven apps into the same tool. Those of us who work in the Maker Portal regularly have become quite familiar with the infamous "Switch to classic" button, because we frequently have to go to the classic experience in order to do certain things.
I have yet to see any documentation announcing any of this, so let's walk through what this new experience for configuring event handlers looks like. I'll include screenshots to compare the new experience to the classic as we go through.
*** In case you haven't heard, Microsoft changed terminology this week with the platform from Entities to Tables and from Fields to Table Columns, as well as renaming the entire Common Data Service to Microsoft Dataverse. See more details here. I did my best to update this post with the new terminology, but you may see some of the old here and there.
Open the new model-driven form designer. Best practice says to do this from within a solution.
Power Apps Maker Portal > Data >
Entities Tables > Forms > Edit form
Find and navigate to the newest pane, Form libraries, and click "Add library".
A new window opens for searching libraries that is much more intuitive than the classic search window.
If you need to create a new library, click "New" and a tab will open with the same form used in the classic form designer.
Upon saving, the tab will close and you're able to select your newly created library to add to the form.
Configure Event Handlers
Now it's time to configure the event handlers.
Whereas before, you could view and configure the different events from a consolidated view (pictured on the right in the below image), you now must navigate to the component for which you'd like to configure an event. For the Form's On Save and On Load events, this means you must select the form from the Tree view pane, because there's no direct way to select it otherwise. This resembles the canvas app experience for configuring an app's OnStart property.
Select the component for which you'd like to configure an event handler, and click the Events tab. You'll see the available events listed here, and I've listed below the options you'll find when selecting various components.
- Form - On Save, On Load (must select from Tree view)
- Tab - On Tab State Change
- Field - On Change
- Header/Footer - none
- Section - none
- Select the Event Type
- Select the Library you added earlier
- Type the function you'd like to call from the library
- Review the checkbox to "Pass execution context as first parameter
- List any parameters to pass to the function
- Click Done, and that's it.
Field Column Dependencies
I see a noticeable difference with this step between the classic and modern experiences. It's best practice to configure
To do this, the dependent fields were selected for each and every Event Handler (see image on the right below). In the new designer, dependent fields are selected for the event itself and apply for all event handlers beneath that. This simplifies things quite a bit for developers.
Another very notable change is that by listing a field as a dependency, you no longer need to add the field to the form. This is huge! I'm surprised I have yet to hear anyone talk about this idea, as it goes against one of the core principles of client-side development. I included the quote below form the Microsoft documentation on web resource dependencies.
I am always happy to see how the Microsoft team will improve the maker experience when rebuilding functionality from the classic Solution Explorer to the new Maker Portal. For this specific feature, I thought they did a great job, and I'll keep looking out for new features to share!
Post a Comment