Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Answered

Passing values to Dialog

(0) ShareShare
ReportReport
Posted on by 64

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?

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

    Thank You sir.

  • Suggested answer
    Anton Venter Profile Picture
    Anton Venter 19,495 Super User 2025 Season 1 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.

  • Verified answer
    GirishS Profile Picture
    GirishS 27,821 Super User 2024 Season 1 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.

  • gaya3 killy Profile Picture
    gaya3 killy 64 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

  • GirishS Profile Picture
    GirishS 27,821 Super User 2024 Season 1 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
    gaya3 killy 64 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

  • Suggested answer
    GirishS Profile Picture
    GirishS 27,821 Super User 2024 Season 1 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.

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

Announcing Our 2025 Season 1 Super Users!

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

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,162 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,962 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans