Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

how to close caller form through++?

(0) ShareShare
ReportReport
Posted on by 3,851

Hi Folks,

I have a form having Ok and Cancel Command Button , in Cancel button I need to call dialog class.

I am calling class like below

  new menuFunction(menuItemActionStr(CreateTrackwiseComplaint),MenuItemType::Action).run();

Dialog form opening but I need to close caller form .

How can I achieve this. 

Regards,

Veer

*This post is locked for comments

  • veeru ogu Profile Picture
    3,851 on at
    RE: how to close caller form through++?

    Thank you very much.

    This way I have already did and got output.

    For dialog class any other approach.

    Regards,

    veer

  • Suggested answer
    Community Member Profile Picture
    on at
    RE: how to close caller form through++?

    Oh I missed the  part that you open a dialog not a form. Instead of opening a dialog you could create an actual form and open and detach it like this:

    FormRun formRun;

    Args args = new Args();

    ;

    args.name(formstr(YOURFORMNAME));

    formRun = ClassFactory.formRunClass(args);

    formRun.init();

    formRun.run();

    formRun.detach();

    this.close();

  • veeru ogu Profile Picture
    3,851 on at
    RE: how to close caller form through++?

    Hi Walters,

    Thank you for your reply ,

    I have tried same code what ever your mentioned , but menuFunction.detach() not available ?

    Is there any alternative way.

    Regards,

    veer

  • Suggested answer
    Community Member Profile Picture
    on at
    RE: how to close caller form through++?

    In semi code the code of you're cancel button has to look like this:

    MenuFunction menuFunction = new MenuFunction(menuitemActionstr(CreateTrackwiseComplaint), MenuItemType::Action);

    Args args = new Args();

    args.caller(element);

    args.record(DS);

    menuFunction.run(args);

    menuFunction.detach()

    this.close()

  • veeru ogu Profile Picture
    3,851 on at
    RE: how to close caller form through++?

    Thank you very for sharing your view .

    i have completed if parent and child are two forms.

    here my scenario i have parent form i.e Runbase Class(dialog form) and child normal form having ok and cancel . if i hit cancel need to get dialog form

    Regards,

    Veer

  • veeru ogu Profile Picture
    3,851 on at
    RE: how to close caller form through++?

    Thanks for your reply

    How can i detach the caller , where i have to write a code for detach.

    Thanks

    veer

  • Suggested answer
    Bashir Ahmad Profile Picture
    5,248 on at
    RE: how to close caller form through++?

    If you really want to close the first detach the caller and close the caller form formRun.detach();

  • Bashir Ahmad Profile Picture
    5,248 on at
    RE: how to close caller form through++?

    Parent should not be closed unless child form is closed

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February 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... 293,097 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,872 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans