In a model-driven app form, to do any validations on record save, we use OnSave event of the form. We bind the event handler function by directly adding it in form properties OnSave or by binding the handler function using addOnSave (formContext.data.entity.addOnSave). When the record is saved (user clicked on Save / Save&Close or auto-save was triggered or save triggered from code using formContext.data.entity.save / formContext.data.save / formContext.data.refresh(true…)), the OnSave handler function is called and we have to use the formcontext.geteventargs().preventdefault() block the default save, perform validations and then trigger another save. We also have to handle what happens after saved depending on how the Save was triggered. As you can see adding custom logic to OnSave event to perform any validation is not very straightforward and not a clean approach and performing any async calls makes it even more complicated.
With the release of 2021 Wave1, Async OnSave feature will allow a promise to be passed to perform validations and if the promise does not resolve within 10 seconds, the save will be blocked. This provide a lot more cleaner pipeline to hook into OnSave with a flexibility to perform complex validations. I have tried to do some tests on my trial instances but the feature is still not available on my environment. I will update this post with sample code once I had a chance to play with it.
Public Preview – Feb 1, 2021 | Early Access – N/A | General Availability – April 2021
What are Async OnSave events?
“This provides the ability to create Async OnSave events. Async OnSave events will now wait when they provide a promise, and there is also a new timeout if the promise does not resolve within 10 seconds. If it does not resolve within 10 seconds, the save operation will be blocked.“
In most of the Dynamics CRM / Dynamics 365 CE or Power platform projects I worked on, there were always requirements to display some sort of notification to the user in model-driven apps. Since there is no out of the box way of displaying notifications to users globally, we had to convince the customers to accept sending email or adding an item to the queue as the notification mechanism or form notifications. In some cases, we had to implement custom solutions, sometime using unsupported methods to display messages. There are third party solutions to display notifications but they do have limitations and obviously you have to pay for most of these. In short there was never an easy and supported way to display global notification to user.
All that is about to change with the release of in-app notifications for model driven apps as part of 2021 Wave 1 release. The feature will only be available for preview in April so I could not do any tests at this point but I will update this post once I have done some testing after the preview is released.
Public Preview – April 2021 | Early Access – N/A | General Availability – June 2021
What is in-app notification?
“Model-driven app in-app notifications are shown to users as a notification toast or notification centre. Notifications are directed to a specific user and can be sent through external systems, Power Automate, or from within the system”
Multi-line text control automatically expands on quick view form
Quick view form, ever since it was released, has been a very useful feature to display data from a related record without copying or duplicating data to multiple tables. Quick view form does have some limitations but overall it has been a life saver in many recent projects I worked on. One of the key limitations we came across with our recent Power Apps solutions is that a multi-line cannot be formatted on a quick view form to display the content in full in a supported way.
Well with release of the 2020 Wave 1, a multi-line column on a quick view form now automatically expands to display the full content like how the multi-line of text column behaves on a main form.
Public Preview – Jan 24, 2021 | Early Access – N/A | General Availability – April 2021
If you check the properties of a multi-line of text column on classic form designer, there is no formatting tab, so you cannot disable this auto expand feature.
And if you check the properties for the same column on Power Apps portal modern form designer, you have the options to set the number of lines or to enable/disable auto-expand feature but these settings are ignored as of now. In the future, Microsoft might implement features to apply these settings but as of now, they don’t take effect.
You must be logged in to post a comment.