Make column section width relative in D365 Business Central cloud

231 views Asked by At

I am a seasoned MS CRM developer with very little experience in BC/AL development.

I have a current CRM client that also uses BC and has I small request I am trying to assist with.

When adding new column sections in a record, the client wants the column section widths to be relative so that the users don't have to scroll down to view the additional column section.

example below:

enter image description here

I have succeeded connecting VS Code to BC cloud tenant and have validated the connection with a simple "Hello World" function after deployed.

May someone point me in the right direction on how to approach the AL I need to use?

Regards.

1

There are 1 answers

0
JohnnyUndercover On

I don't think there is an easy solution for what you are searching for.

You can take a look at "Grid Layout" for pages, but grid layouts are not that relative. https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-arrange-fields-in-rows-and-columns-using-gridlayout-control

With Grid Layouts you can define columns and put your fields in these columns. How i understand you want to change an existing page (item page) so you could try somthing like this:

pageextension 50100 ItemCardExtension extends "Item Card"
{
    layout
    {
        modify(Item)
        {
            Visible = false;
        }
        addafter(Item)
        {
            grid(MyGrid)
            {
                group("Column1")
                {
                    // Add fields here
                }
                group("Column2")
                {
                    // Add fields here

                }
                group("Column3")
                {
                    // Add fields here
                }
            }
        }
    }
}

But there will be some additional Problems, if you add all fields you need to implemnt all the exitsing Code (triggers on page level) by yourself (personally i wouldn't do this). Maybe you could try and add only one field by code for each group and add all other fields from the client with personalisation, but i never tried that.