Announcements
No record found.
Hi,
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
This should help,
https://community.dynamics.com/ax/f/33/t/6874
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.
Hi Vilmos,
I want to display value from 1 form in 2 form accourding to "No contrat"
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
ok thanks Srinivas,
i want to disply in this grid records from table contrat and table contratlines how can I do it?
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;
}
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?
www.axaptapedia.com/Passing_values_between_forms
i should add the 1 table in the datasource of the 2 form?
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.
Congratulations to our 2026 Super Stars!
We are thrilled to have these Champions in our Community!
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Basit 1
GL-01081504-0 1
Roya 1