Updating two forms through Click Event

Hi Friends,

Here Am using Two Tables Table-A and Table-B and also am using Two Forms A and B…Form A having one command button.while am clicking this button.Table -A and Table-B data automatically updated.how can do that…pls anyone help me for that.



Please tell us more about your requirements. What “data automatically updated” exactly means? What you want to do at form level and what at database level? Why are you using a command button (instead of a menu item button as usual) and what the command is? Why are you copying data instead of just passing a reference? What’s your version of AX?

Am using Ax 2009 version.For Example Update button in Form A .suppose am clicking this button…form field value passing to the next form B.Here am See that Value in Form and save it.Suppose here am update this value.Form Aalso updated…how can i do this.

You haven’t explained the command button, so throw it away and use a menu item button (with menu item point to Form B) instead. Set Table A as to the DataSource property of the button. Now the active record will be automatically send to Form B.

In Form B’s init(), read the record received from Form A by element.args().record().

Copy the value of the field you’re interested in to another record and save it to database.

it’s already am done…now am do any changes in Form B…automatically Form A Data changed …

how can i do that…for writing any write method in Data Source…pls me Mr.Martin

Sorry, I don’t understand what you’re saying, e.g. what “for writing any write method in Data Source” means. Could you rephrase it to sentences?

OK Mr.Martin Here using Two Tables Student Details,Student Personal Details

Student Details

Student Id Student Name Class/Department

101 A Class A

102 B Class A

Student Personal Details

Student Id Student Name Father’s Name Address 101 A AAA BBB

102 B BBB CC

What’s my Problem is Now Am Changing Student name in Student Personal Details Table means automatically Student Name Changed in Student Details Table.Same thing Reverse in Student Detail Table…

I hope you understand that Mr.Martin

The main problem is that your database schema is not designed correctly, namely you’re violating second normal form. To normalize the schema, keep information about students in a single table only. The other table seems to represent m:n mapping between students and classes and it should contain only primary keys (such as Student Id). If you need Student name, simply join tables together.

If you had to maintain duplicate data, you would have to do it in a transaction in update() method of Student person details (don’t even think about changing it in the mapping table too, it doesn’t make sense). Notice that it has nothing to do with any form or even a clicked event; you have to maintain database integrity as a lower level.