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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Displaying Form

(0) ShareShare
ReportReport
Posted on by 932

Hi,

5756.Sans-titre.png

I have 2 forms like see in image.

I want to get values   circled in red from the first form according to the field "No Contract", how can I do it?

Thanks.

*This post is locked for comments

I have the same question (0)
  • Andrew Xu Profile Picture
    3,877 on at

    This should help,

    https://community.dynamics.com/ax/f/33/t/6874

  • Suggested answer
    Vilmos Kintera Profile Picture
    46,149 on at

    Your request is very unclear on what do you mean by getting values. It all depends that from WHERE do you want to read out the values, since the context is very important.

    Generally speaking, set auto declaration for the fields, then you could read out the values directly from the form controls in the top group of the child form. You can also read out the table.field value bound by the datasource against the controls in the grid.

    If you are talking about accessing those values from the parent datasource, it just depends on how do you want to design it. Since they are likely values stored in a table, why don't you just simply fetch the relevant records (select statement, or form datasource joined against the parent table).

    If this is not what you want, then please explain what do you expect better.

  • BASMA Profile Picture
    932 on at

    Hi Vilmos,

    I want to display value from 1 form in 2 form accourding to "No contrat"

  • Suggested answer
    Srini Ramidi Profile Picture
    2 on at

    Hello,

    On your contract lines screen,  expand the data sources>expand lines data source table>right click on the methods >Override method> choose "Create" method. Add your logic to read the data  from Contract header table. If the header table is part of the data sources you can write some thing  like ContratLine.Nature=ContratHeader.Nature.  Take a look in form SalesTable and see the code in Create method in SalesLine Data source.

    Best,

    Srini

  • BASMA Profile Picture
    932 on at

    ok thanks Srinivas,

    i want to disply in this grid records from table contrat and table contratlines how can I do it?

  • Suggested answer
    Srini Ramidi Profile Picture
    2 on at

    As said add some code to Create method to read the values from Contrat table. something like this:

    contrat  contrat;

    select contrat  where contrat.NoContrat==@NoContrat(field name.text());

    if(contrat)

    {

       contratlines.Natture=contrat.Nature;

    }

  • BASMA Profile Picture
    932 on at

    0385.Sans-titre.png

    thanks Srinivas but i can't get values from 1 form.

    I want when i click on button circled , it will open the 2 form and get values from the 1 form

    How can I do it?

  • Suggested answer
    Vilmos Kintera Profile Picture
    46,149 on at

    www.axaptapedia.com/Passing_values_between_forms

  • BASMA Profile Picture
    932 on at

    Hi Vilmos,

    i should add the 1 table in the datasource of the 2 form?

  • Suggested answer
    Vilmos Kintera Profile Picture
    46,149 on at

    Having the same tables on the two forms, or tables that have a correct relation between them, then setting the Datasource property on the menu item button for opening the child form could automatically do the filtering for you.

    Or you could pass in the field value (contract number) that you want your child form to be filtered based on through Args.

    Alternatively you could pass in the parent forms' table in the Args.record() call, then use that for filtering the value as a query range on the child form datasource.

    Third option is to do as per the last step, pass in the record, but you could override linkActive method on the child form datasource, and then do a dynalink on element.args.record() value, so it whenever you change rows on the parent form by highlighting another line, it would automatically change it on your child datasource too.

    You can find examples online for all solutions.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Basit Profile Picture

Basit 1

#1
GL-01081504-0 Profile Picture

GL-01081504-0 1

#1
Roya Profile Picture

Roya 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans