How to set the default view for OOTB calendar control?

How to set the default view for OOTB calendar control?

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

Figure 1 - PowerApps grid control parameters


However, others, like the Calendar control ??, come with limited parameters and minimal customization options.

Figure 2 - Calendar control parameters

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.

Figure 3 - DefaultCalendarView property description


?? 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! ??

Figure 4 - User Settings Utility addon of XrmToolBox

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

Figure 5 - Plugin example

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? ??

Scott Durow??

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.

回复
Nuno Subtil

Software Engineer at Roboest | Power Platform, Dynamics 365 & Azure

6 个月

This is great, was actually looking for this a while ago.

要查看或添加评论,请登录

Yurii Nazarenko的更多文章

社区洞察

其他会员也浏览了