Skip to main content

Notifications

Microsoft Dynamics AX (Archived)
Answered

How to auto resize the dialog form?

Posted on by 1,200

Hi,

I have a created a class inherited from RunBaseBatch class with the dialog as displayed below. 

The dialog form displays a dynamic dialog Field based on the job selected but the form did not auto re-size to cover all fields. And instead display the horizontal bar. How do I get rid of this or how do I set the dialog form to automatically resize?

2015_2D00_05_2D00_15_5F00_19_2D00_26_2D00_25.png

2015_2D00_05_2D00_15_5F00_19_2D00_28_2D00_35.png

Thanks,

Paul

*This post is locked for comments

  • Suggested answer
    Paul1 Profile Picture
    Paul1 1,200 on at
    RE: How to auto resize the dialog form?

    Thanks Martin. It did work!

  • Paul1 Profile Picture
    Paul1 1,200 on at
    RE: How to auto resize the dialog form?

    Hi Sohaib,

    Using the widthMode did not work but setting the width explicitly do. But still not an auto resize. :)

    Thanks,

    Paul

  • Verified answer
    Martin Dráb Profile Picture
    Martin Dráb 229,993 Most Valuable Professional on at
    RE: How to auto resize the dialog form?

    Try the following (not tested):

    1. Get the underlying FormRun (dialog.formRun()).
    2. Lock it (FormRun.lock())
    3. Add/show your dynamics controls
    4. Call FormRun.resetSize()
    5. Unlock the form (FormRun.unlock())
  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to auto resize the dialog form?

    static server void Job2(Args _args)

    {

       Dialog  d = new Dialog();

       d.addField(extendedTypeStr(CustAccount));

       //d.formBuildDesign().heightMode(1);

       d.formBuildDesign().windowResize(true);

       d.run();

    }

  • Suggested answer
    Sohaib Cheema Profile Picture
    Sohaib Cheema 46,610 User Group Leader on at
    RE: How to auto resize the dialog form?

    you can try two things

    for fields kindly try to set width

    DialogFieldName.widthMode(FormWidth::ColumnWidth);

    if issue is not resolved by above, use following line also

    dialog.form().design(1).width(

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

New! Quick response templatesâš¡

Save time with the new custom templates!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,151 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,993 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans