How to set the default view for OOTB calendar control?
Yurii Nazarenko
??Helping business digitalize its processes and build modern data-driven customer friendly solutions |??Senior Software Engineer | Power Platform | Dataverse | Dynamics
?? Unlocking the Secrets of Customizing OOTB PCF Controls in Dataverse
Have you ever tried customizing out-of-the-box (OOTB) PCF controls in Dataverse? Some controls, like the PowerApps grid control, offer straightforward configuration options ???.
However, others, like the Calendar control ??, come with limited parameters and minimal customization options.
Recently, a customer requested the ability to modify the default behavior of the calendar view, but the official documentation had no relevant guidance ??. So, I embarked on a debugging journey of my own.
?? Through the developer console, I discovered that the calendar settings were linked to the UserSettingsCollection table. After several hours of digging through the code, I finally identified how the default view for the Calendar control is set. The key parameter? It’s DefaultCalendarView within the UserSettingsCollection table.
领英推荐
?? Great Discovery – But What’s Next?
The next challenge was figuring out how to modify this setting for all users in the environment ??. Fortunately, the XrmToolBox comes to the rescue with its handy add-on, User Setting Utility ???. This tool allows you to update the DefaultCalendarView for existing users.
?? However, there’s one downside: there's no built-in way to deploy this customization through a solution. If anyone has found a way around this, I’d love to hear your suggestions! ??
?? What’s the Best Approach?
For existing users, the User Setting Utility is the easiest method to apply changes. For new users, I recommend creating a custom C# plugin that triggers on the Post-Create (async) event of the systemuser table. Below is an example of how to implement this logic.
If you're looking to streamline your environment’s calendar functionality ??, this approach is definitely worth exploring! ??
Did you find this article helpful, or is it something you were already familiar with? ??
Microsoft Cloud Developer Advocate 10 x Microsoft MVP #PowerPlatform #ProCodeNoCodeUnite
5 个月That's a neat approach to set default user settings using a plugin! I wonder if you could do the same with a Cloud Flow? Users can change this setting for themselves using 'Personalization Settings' under the gear icon in Model Driven Apps. You can find the setting under the 'Activities' tab -> Default Calendar.
Software Engineer at Roboest | Power Platform, Dynamics 365 & Azure
6 个月This is great, was actually looking for this a while ago.