web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

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

Passing values to Dialog

(0) ShareShare
ReportReport
Posted on by 70

pastedimage1684480844567v4.pngpastedimage1684480860239v5.pngpastedimage1684480873529v6.png

I want to pass account number of the active record to the second dialog(which opens when next is clicked in the form) , how can i achieve it?

I have the same question (0)
  • Suggested answer
    GirishS Profile Picture
    27,825 Moderator on at
    RE: Passing values to Dialog

    Hi,

    You need to pass the caller record of the first form DataSource. Using element.args().record - You will get the caller record - Pass the same buffer while calling the second dialog form.

    Thanks,

    Girish S.

  • gaya3 killy Profile Picture
    70 on at
    RE: Passing values to Dialog

    In the above scenario i need the data flow from  1st form to last dialog without 2nd dialog.is it possible? because the 1st opened dialog has no relation with form or 2nd dialog and no data also

  • GirishS Profile Picture
    27,825 Moderator on at
    RE: Passing values to Dialog

    You can maintain the caller record as first form DataSource and pass the same caller record while calling the 1st and 2nd dialog.

    Thanks,

    Girish S.

  • gaya3 killy Profile Picture
    70 on at
    RE: Passing values to Dialog

    But the 1st dialog doesn't have any data related to the form which i needed in 2nddialog

  • Verified answer
    GirishS Profile Picture
    27,825 Moderator on at
    RE: Passing values to Dialog

    But you can maintain the caller record. Below the code for 1st dialog form.

    Public class Dialog1 extends formRun
    {
        TableNameForm1 form1Table;
        
        public void init()
        {
            form1Table = element.args().record();
        }
        
        //calling the second form through code
        public void clicked()
        {
            Args args;
            Object formRun;
            args = newArgs();
            args.record(form1Table);
            args.name(formstr(FormName));
            formRun = classfactory.formRunClass(args);
            formRun.init();
            formRun.run();
    
        }
    }

    Beow the code for 2nd dialog form.

    Public class Dialog2 extends formRun
    {
        TableNameForm1 form1Table;
        
        public void init()
        {
            form1Table = element.args().record();
        }
        //you can use form1Table buffer to get account num and use it in the 2nd form
        Control.Valuestr(form1Table.AccountNum);
    }

    Thanks,

    Girish S.

  • Suggested answer
    Anton Venter Profile Picture
    20,303 Super User 2025 Season 2 on at
    RE: Passing values to Dialog

    One option could be, when opening the second dialog from the first dialog, you can also set a record or data in the Args object. Then in the second dialog, you can access the Args object and the record/data with element.args(). There are many examples in the application and online on how this is done.

  • gaya3 killy Profile Picture
    70 on at
    RE: Passing values to Dialog

    Thank You sir.

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…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

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

#2
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 636

#3
Martin Dráb Profile Picture

Martin Dráb 553 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans