Interview Questions

Monday, June 9, 2014

Some very important form methods and their use in AX

FormDataSource.Init
This method initializes the data source and is called from the super() of FormRun.Init(). The method is only called once when the form opens. The main task for this method is to initialize the query used for fetching data. To modify or replace the query automatically created by the form, do this after
the super() call of this method.

FormDataSource.InitValue
This method is used to initialize a new record with default values. The super() of this method calls the initValue() method on the underlying table. If you have initialization that applies system-wide, put the code on the table.

FormDataSource.Active
This event is called when a new record becomes active in the data source. This method is typically overridden to change properties which depend on the contents of the current record: Commonly this method will:
• Modify permissions to the data source
• Modify permissions to the fields
• Enable/Disable buttons

FormDataSource.LinkActive
This method is the engine that joins data sources. This method is called on the joined data source every time that the active record in the main data source is changed. The method is also called when the form is opened as the system tries to join the calling data source to the main data source of the called form.

FormDataSource.ValidateWrite
This method validates an insert or update of a record. The super() of this method calls the corresponding method on the underlying table. If you need to distinguish between an insert and update, make a condition on the RecId field, which only has a value if it is an update.

FormDataSource.Write

This method controls the insert and update of records. The super() of this method calls the corresponding method on the underlying table. If you have form-specific tasks to perform in relation to the commitment of the record, add it here.

No comments:

Post a Comment