Today I would like to talk about how to set default Freeze Pane via AL in Business Central.
As you might know, we can set/clear Freeze Pane in a list via Personlization.
|What do you want to do||How to do it||Remarks|
|Change the freeze pane in a list to another column.||Choose the arrowhead of the column that you want as the last column of the freeze pane, and then choose Set Freeze Pane.|
If you want to set the freeze pane back to its original designed position, choose the arrowhead for the current freeze pane column, and choose Clear Freeze Pane. Note: You can’t remove this freeze pane.
|The freeze pane specifies the columns that always appear on the left, even as you scroll horizontally.|
Test Video: This is very useful.
So, can we set default Freeze Pane for all users?
Yes, administrators can customize pages for a profile, according to the related business role or department, for example, so that all users that are assigned the profile will see the customized page layout. The administrator customizes pages by using the same functionality as users do when they personalize pages.
More details about Customize Pages for Profiles.
This is a very good way because we can do it without any customization. But if you want to talk about the disadvantages of this way, you need to set them up separately for each one if you use many Roles in your environment.
In this post, I will share another way, set default Freeze Pane via AL. It’s actually not that difficult. This time we can use FreezeColumn Property.
FreezeColumn Property: Specifies the columns in a list that remain in view on a page, even when you scroll right.
Applies to: Page Group
Remarks: The property is useful when you have a list that has many columns that extend beyond the control’s boundaries, which require that you scroll right to see all columns. This property lets you specify columns that always remain in view, even when you scroll through the remaining columns. To set the property, you select a column. The column that you select and all columns before it remain in view on the page.
You can find a simple example in page 314 “General Posting Setup”
And the property ‘FreezeColumn Property‘ can be customized through a page extension.
Isn’t it useful? Give it a try!!!😁
PS: If you don’t know how to find the specified Group and Field for Freeze Pane, you can use the Design feature in Sandbox and download the code.
In Designer: (Currently, Designer is only available from a Dynamics 365 Business Central sandbox)
Hope this will help.
Thanks for reading.