Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

Reproducing the "Open in new window" functionality

(1) ShareShare
ReportReport
Posted on by 3,542

Hi folks

There exists standard functionality to move a form to a separate pop-up type window (provided certain conditions).

7658.Screenshot-2019_2D00_11_2D00_11-at-13.01.37.png

4377.Screenshot-2019_2D00_11_2D00_11-at-12.55.56.png

For implementation X of mine I thought it good to open some form as a pop up by default. I thought it to be a simple task, but no.

I am reasonably sure that what I am trying to do has purposely been made impossible by MS for some reason. I am looking for some confirmation or correction. If there is a developer that has time to check me up, here are all the details you need:

The method that creates the button can be viewed in SysSystemDefinedButtons, lines 1194 through 1210.

private void AddPopoutButton(FormButtonGroupControl parentButtonGroup)
{
    FormCommandButtonControl popoutButton;
    
    if (!this.isControlFound(SystemDefinedPopoutButton))
    {
        popoutButton = parentButtonGroup.addControl(FormControlType::CommandButton, SystemDefinedPopoutButton);
        popoutButton.command(PopoutCommand);
        popoutButton.imageLocation(SysImageLocation::Symbol);
        popoutButton.normalImage("PopoutExpand");
        popoutButton.buttonDisplay(ButtonDisplay::ImageOnly);
    }
}

The command assigned to the button comes down to macro #taskPopout defined in macro file #Task. The name of the button will be "SystemDefinedPopoutButton", defined in line 19 of macro SysSystemDefinedButtons.

If we use BankAccountTable and BankAccountTrans as example (just for demonstration), the following class should do the trick:

[ExtensionOf(formStr(BankAccountTrans))]
final class BankAccountTransFormXYZ_Extension
{
    void run()
    {
        #Task

        next run();

        if (this.args().callerName() == formStr(BankAccountTable))
        {
            this.task(#taskPopout);
        }
    }

}

But it does not. The next step in my mind was to mimic the user clicking the button. In which case run() will look like this:

void run()
{
    #SysSystemDefinedButtons

    next run();

    if (this.args().callerName() == formStr(BankAccountTable))
    {
        FormCommandButtonControl popoutButton = this.control(this.controlId(#SystemDefinedPopoutButton));
        popoutButton.clicked();
    }
}

No success. Further step would be to create your own button that does the same thing as SystemDefinedPopoutButton. 

[ExtensionOf(formStr(BankAccountTrans))]
final class BankAccountTransFormXYZ_Extension
{
    internal FormCommandButtonControl popoutButton;
    #Task

    void init()
    {
        next init();

        this.createPopoutButton();
    }

    private void createPopoutButton()
    {
        FormButtonGroupControl buttonGroup = this.control(this.controlId(formControlStr(BankAccountTrans,ButtonGroup)));
        popoutButton = buttonGroup.addControl(FormControlType::CommandButton,"DuplicatePopoutButton");
        popoutButton.command(#taskPopout);
        popoutButton.imageLocation(SysImageLocation::Symbol);
        popoutButton.normalImage("PopoutExpand");
        popoutButton.buttonDisplay(ButtonDisplay::ImageOnly);
    }

}

The button works like the standard one (when you click on it). But then we want to hide the button and call it from code. The result is the same as the original method - just nothing happens. And debugging doesn't help as we are working with kernel methods.

I have tried various other variations - but I am sure the details above are enough.

It looks like the functionality will only work if one physically clicks on a command button with this task assigned to it. Then my only conclusion is that MS has purposely made this difficult or possibly impossible to achieve from code.

Any suggestion, confirmation or comments are welcome.

Thanks for reading this far.

  • Crispin John Augustine Profile Picture
    37,081 on at
    RE: Reproducing the "Open in new window" functionality

    I am pretty sure of reading a MS documentation on patterns somewhere. It was quite telling indeed, about the focus on a consistent user experience regardless of function / device.

    Btw, I also think it is a slight discomfort, not being able to see multiple forms at the same time (as compared to opening different windows in different monitors in the older versions..)

    Got to live with it.

  • Pete Alberts Profile Picture
    3,542 on at
    RE: Reproducing the "Open in new window" functionality

    Hi Crispin, thank you for the interest!

    I think you are correct. That is my guess as well. Would've been nice if MS documented it somewhere...

    I am very serious about following standards, BP, anything mr Drab says and convention. But in this case it made sense to deviate from the standard. The host form is a workspace and the detail form (new window) contains very little additional detail - the user will never want to leave the workspace just to see a few extra fields. Would've been nice if they could see the detail on a little pop-up form while traversing the list.

  • Crispin John Augustine Profile Picture
    37,081 on at
    RE: Reproducing the "Open in new window" functionality

    I think, this is to make the application UI as much uniform as possible, in the same way form design patterns are meant to..

  • Pete Alberts Profile Picture
    3,542 on at
    RE: Reproducing the "Open in new window" functionality

    Hi Anup

    1) That guy was actually asking about dialogs and how buttons work.

    2) Yes that is the standard functionality.

  • Anup Shah MSFT Profile Picture
    on at
    RE: Reproducing the "Open in new window" functionality

    A couple of similar discussions in past are here, they may help:

    (1) community.dynamics.com/.../creating-pop-up-form

    (2) docs.microsoft.com/.../display-pages-side-by-side

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,127 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,871 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Product updates

Dynamics 365 release plans