web
You’re offline. This is a read only version of the page.
close
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

I have the same question (0)
  • Bashir Ahmad Profile Picture
    5,248 on at

    Parent should not be closed unless child form is closed

  • Suggested answer
    Bashir Ahmad Profile Picture
    5,248 on at

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

  • veeru ogu Profile Picture
    3,851 on at

    Thanks for your reply

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

    Thanks

    veer

  • veeru ogu Profile Picture
    3,851 on at

    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

  • Suggested answer
    Community Member Profile Picture
    on at

    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

    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

    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

    Thank you very much.

    This way I have already did and got output.

    For dialog class any other approach.

    Regards,

    veer

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans