I have create my own form in AX 2009. Also bind it with my own Data Table.
There is a stringEdit control on this form which is bind to the DataMethod which is declared under the Form’s datasource’s datatable.
I have set the Mandatory property of this stringEdit control on the form to “YES”.
Now the problem is when i close the form without entering any value in this stringEdit control, it allows me to close the form. But the desired result is the control does not allow me to close the form without entering any value in the stringEdit control.
can you please tell me what steps do i required to perform to simply implement the mandatory field on the form, which is directly bind to the Table field(Not the datamethod)?
What i have done in the test environment is,
i have created a simple table with a single string type filed (without any EDT assigned) and set its Mandatory property to YES.
Then create a simple form with only one control StiringEdit and set its Datasource property to the Datasource in the step 1 and the DataField property to the field of the table of step 1.
Now run the form, it shows the stringEdit control field with the red highlighted but if i close the form without entering anything in the control it allows me to close the form. It has dont even warn me for the mandatory field.
create validateWrite() method on table you have created.
in this method write code to check return value of method which is associated with your stringEdt control, depends on that return value return TRUE or FALSE.