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 :
Finance | Project Operations, Human Resources, ...
Answered

Parent form auto refresh after okay click of the Child form

(0) ShareShare
ReportReport
Posted on by 6
Hi ,
I have a created a Parent form (Form 1) and in the parent form we have a field of status in the parent form,
when i opened a form through button click (pass the form name in the argument) after fill the data , when i clicked OK in child form , i have to refresh the form then the status is updating , but i want that when i click OK , the parent form status field should be auto refresh and changes the status.
 
Can please help me on this scenario ?
I have the same question (0)
  • Verified answer
    André Arnaud de Calavon Profile Picture
    301,069 Super User 2025 Season 2 on at
    Hi Sam,
     
    Here is an approach which I extracted from an example that I created before on AX 2012.
     
    On form1 you can have a button that will open form 2 with e.g. the next x++ coding on the clicked() method.
    FormRun     formRun;
    Args args = new Args();
    
    args.name(formstr(Form2));
    args.caller(this.formRun());
    
    formRun = ClassFactory.formRunClass(args);
    formRun.init();
    formRun.run();
    
    if (!formRun.closed())
    {
        formrun.wait(true);
    }
    Besides, have a method that can receive and update the status.
    public void updateStatus(str _status)
    {
        status = _status;
    
        StatusControl.text(status);
    }
    
     
     
    Form 2
    On form2, you can create the next form variable:
    Object  callerForm;
    On the init() method put the next coding:
    super();
    
    callerForm = this.args().caller();
    
    On the close() method add the next statements.
    if (callerForm)
    {
        callerForm.updateStatus(StatusControl.text());
    }
    
    super();
     

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 592 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 478 Super User 2025 Season 2

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 305 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans