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

passing values using Args() class

(0) ShareShare
ReportReport
Posted on by


Args.JPG
Hi all ...
I am just trying to send a string from Form1 to Form2 by clicking on button on Form1
after I make some search on the internet, I found this approach that sending and opening the Form2
about me I don't want Form1 open Form2 because Form2 already opened, and I want Form2 receive the value automatically
Help please.

I have the same question (0)
  • Martin Dráb Profile Picture
    237,803 Most Valuable Professional on at

    If you Form1 has a reference to the FormRun object of Form2 (e.g. because it was open from Form1), you can simply calls a method of Form2 and pass the value there. If you just have two forms that aren't aware of each other, the task isn't easy and you should rather come with a different design.

    Note that it's not "Args class issue" in either case, therefore you should rather update the title of this thread.

  • GirishS Profile Picture
    27,827 Moderator on at

    In addition to Martin comments, it seems that you are using string control for both the forms, So its not possible to pass value from first form to second form if it is not called from the first form.

    If the string control is table level field you can update the string value entered in form 1 table to form 2 table. But you need to press F5 to see the data in the Form 2.

    Thanks,

    Girish S.

  • 365 financial Profile Picture
    on at

    thanks Martin for your response and I changed the title of this thread. Yes, the two forms don't relate to each other so what is the design that I should to have?

  • 365 financial Profile Picture
    on at

    Thank u Girish Your response was helpful

  • Martin Dráb Profile Picture
    237,803 Most Valuable Professional on at

    Well, how do you intend to determine which form your want to update? I can have multiple instances of Form2 running (or none). And you don't have a reference to any of them.

    Let's let's forget implementation details for now. Instead, tell us what business requirement you're trying to implement.

  • 365 financial Profile Picture
    on at

    Ok I have a form with a grid that read a one row of data from a DataSource, in this form there is a button when I press it a new form is opened this form contain:

    1- string edit value that comes from another DataSource

    2- OK button

    So, when I press the OK Button the value in the string edit must be passed to a field in a DataGrid of the main form.

    I hope that is clear

  • Martin Dráb Profile Picture
    237,803 Most Valuable Professional on at

    That sounds easy. You should be able to get a reference to the main form by calling element.args().caller().

  • 365 financial Profile Picture
    on at

    ok martin now if I get the caller of the parent form how can i pass for example a string value from child form to the parent

    can you give me some lines of code please

  • Verified answer
    Martin Dráb Profile Picture
    237,803 Most Valuable Professional on at

    You can use a method and pass the value through a method parameter. For example:

    FormRun callerForm = element.args().caller();
    callerForm.myMethod(strEdt2.text());

  • 365 financial Profile Picture
    on at

    thanks a lot..

    it is done

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 664 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 303 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans