AL icon indicating copy to clipboard operation
AL copied to clipboard

Not possible to add Factbox after factboxes without name

Open Nyryus opened this issue 7 years ago • 5 comments

In page extension, is not possible to add a factbox with addafter statement, if the factbox doesn't have a given name.

pageextension 18122140 "EOS PagExt18122140" extends "Customer Card" //21
{
    layout
    {
        addafter("Customer Picture")
        {

        }

        addbefore("Customer Picture")
        {

        }

        addafter("Attached Documents")
        {

        }

        addbefore("Attached Documents")
        {


        }
    }
}

The code is expected to let us add factboxes after/before all the standard factboxes.

immagine

Versions:

  • AL Language: 3.0.145991

Nyryus avatar Jul 05 '19 13:07 Nyryus

Have you tried using the actual name with < and > ?

pageextension 18122140 "EOS PagExt18122140" extends "Customer Card" //21
{
    layout
    {
        addafter("<Customer Picture>")
        {
        }

        addbefore("<Customer Picture>")
        {
        }

        addafter("Attached Documents")
        {
        }

        addbefore("Attached Documents")
        {

        }
    }
}

AskeHolst avatar Jul 08 '19 08:07 AskeHolst

Yes, but it doesn't work.

immagine

Nyryus avatar Jul 08 '19 08:07 Nyryus

You are right, it is the control ID you need to use

pageextension 18122140 "EOS PagExt18122140" extends "Customer Card" //21
{
    layout
    {
        addafter(Control149)
        {
        }

        addbefore(Control149)
        {
        }

        addafter("Attached Documents")
        {
        }

        addbefore("Attached Documents")
        {
        }
    }
}

AskeHolst avatar Jul 08 '19 08:07 AskeHolst

You are right. At this point, I think Microsoft should consider this as a suggestion and add the possibility to use the name, that is ways easier to remember and find. Because in October, will be easier to use "Customer Picture", than check in Microsoft repo, which is the control name.

Nyryus avatar Jul 08 '19 10:07 Nyryus

Hi! The problem here is that the name of the control is not explicitly set and we are trying to generate a name that will not clash with the name of other controls on the page. The names for parts that have not had their name explicitly set in C/AL is always Control{Id} in the generated symbols.

With the switch to AL, all controls will have the name explicitly set in code. If you are still working on the C/AL base, you can use F12 to see the definition of the page you are modifying and see what the names of the controls are.

In the last months, we have been hard at work on the next release of the developer tools. You can read Freddy's blog post to find out more https://freddysblog.com/2019/07/31/preview-of-dynamics-365-business-central-2019-release-wave-2/ . Let us know what you think!

atoader avatar Aug 02 '19 14:08 atoader