Hi,
I have a question regarding the form management best practices.
I saw that there is a class PmfFormCtrl which is used to manage the behavior of some AX forms.
This class has various methods to manage form data sources and form controls. For example datasourceActivePost, datasourceCreatePre, datasourceDeletePost, datasourceValidateWrite, fieldModified, fieldValidate, enableDSFields, enableFormControls and etc....
I can create a class (MyFormCtrl) that inherits from PmfFormCtrl class and to use his methods to manage my form. To assume that I have to do some restrictions in the table which is a data source in my form.
I can do it in validateWrite method of my table, or in MyFormCtrl class. If I do it in MyFormCtrl class, I have to override his validateWrite method. After that I have to call myFormCtrl.validateWrite() method in the form data source validateWrite event method of my form in order to process the restriction. In this case my restriction will work at the form level, otherwise at the table level. I know that the best practice is to create a class that manages the form because it requires less efforts in the future upgrades.
My question is what is the best practice in this case? Where I have to manage such restrictions? At the table level or at the data source level?
I guess you will say that it depends whether the restriction should be done over entire table or only in some functionality where the table takes a part. However, I would like to know your opinion.
Best Regards,
Jaret.