How to overwrite a method “modified” in a dialog on AX 2009/2012

How to overwrite a method “modified” in a dialog on AX 2009/2012

Generally a method “modified” is overwritten in an AX form. When you use a dialog you cannot do this operation. Now we will teach you how to do it in a dialog.  We will make an exercise where you choose a path to save the file with a specified name, using dialog. This includes the following steps:

1.- Create a class AND_PreAvisoV2 that have a extends RunbaseBatch

Nueva imagen

 

2.- Create a method dialog with this class.  Here we put the title of the dialog and a field where we can choose the path where the file will be saved.

Nueva imagen (1)

3.- We need to create the “modified”  in another method on the same class to make the name come up with the specified code:

Nueva imagen (2)

4. Execute the dialog where we can choose the path to save the file. Click on accept. With this,  the file is saved in the path specified.

Dialog execution:

Nueva imagen (3)

Choose the path:

Nueva imagen (4)

 

 

 

 

Click on OK, now we can see the path and the file name.

Nueva imagen (5)

 

5.- We can see the file saved at the path specified, that is desktop

Nueva imagen (6)

We have demonstrated with an illustrative example, how to overwrite a method “modified” in a dialog on AX 2009/2012

  • Dmitri Ratushnyak

    Hello. I have a problem – the empl of control have no modified() method. AX09. What had i do then?