Tuesday, October 26, 2021

All methods in D365 FO

 Table Methods

Modified Field : Each time the value of a field is changed ,this method is called.

Init Value : It is used to set a default value for the fields.If we create a new record from the table browser “initvalue” is executed(runs when we create a new record).

Validate Field : It is used for validation only and will return true or false.Each time the value of a field is changed the method ValidateField() is called.

Validate Write : It works like mandatory field(setting) (runs when you save the record).

Validate Delete : while deleting a method if we want to put any validation we can use this method.

 

//Insert update find exist

 

Form Methods

Activate : When a form receives focus.Returns boolean data type that specifies whether a form has focus.

CanClose : When aform is closed.specifies whether you can close the form.The call to the super in the method checks whether closing the form is a valid action.

Closed : The form is closed.use this method to check whether the form has been closed.

Close : The form is closed.the call to the super in this method closes the form window,manages database updates and sets the closed method to true.

CloseCancel : Use this method to check whether the form has been closed by a cancel action.the method is set to true if the form is closed by a cancel action.

CloseOk : The user presses an ok button.specifies whether the form wasa closed by clicking the ok button.the call to the super method sets the boolean flag closedok and calls the close method.

InIt : The form is opened.use the method to initialize a form.the init method I started immediately after the new method and creates the run time image of the form.you must call the super method if you override this methpd and you should add your code before the super call.

Run : The form is opened.Call the run method immediately after the init method.The call to the super method makes the form window appear on the screen and performs a database search for the data to be displayed in the form.


Form Control Methods

Validate : The user exists a control after entering data.

Lookup : The user uses the lookup facility.

Modified : The user exits an edit field after changing it.The user changes a value in a checkbox,combobox,listbox or radio button control.The super call manages the table update.

 

Form Datasource Methods

Active : The user selects a new record.Retrieves data from joined datasource when a user moves to a new record.

Create : The user creates a new record in the datasource.If you use this method to specify field values,the new value are saved to the database when you leave the form.

Delete : the user deletes a record in the datasource.Deletes the current reord from the datasource.

ExecuteQuery : The form is opened for data display.Executes the datasource query and displays the retrieved records.

Filter : The user starts one of the filter commands on the form shortcut menu.Filter records in the datasource.

FindRecord : Activated by the find value method.Finds the specified record in the database and makes it the current one.

InIt : The form is opened.Creates a datasource query based on the datasource properties.

InItValue : A new record is created.The purpose is to fill in initial values in the record.Initializes field values in a new record.If you use this method to specify field values,the new values are not automatically saved to the database when you leave the form.To specify values that you want to save when you leave the form,use the created method.

LinkActive : The user selects a new record in a form that has a datasourcelinked to another datasource.Calls the FormDataSource.executeQuery method on data sources that are linked to the current data source.

Refresh : Not sgtarted by the system.Updates the form by refreshing the view of all records in the datasource.WILL NOT REREAD THE RECORD FROM THE DATASOURCE.IT BASICALLY JUST REFRESHES THE SCREEN WITH WHATEVER IS STORED IN THE FORM FROM THE CACHE.

Reread : Not started by the system.Rereads the current record from the datasource.WILL ONLY REREAD THE CURRENT RECORD FROM THE DATABASE SO YOU SHOULD NOT USE IT TO REFRESH THE FORM DATA IF YOU HAVE ADDED/REMOVED RECORDS.

Research : Not started by the system.Refreshes the database search defined by the query , specified by the FormDataSource.init method.WILL RETURN THE EXISTING FORM QUERY AGAINST THE DATASOURCE,THEREFORE UPDATING THE LIST WITH NEW /REMOVED RECORDS AS WELL AS UPDATING EXISTING ONES.THIS WILL HONOUR ANY EXISTING FILTERS AND SORTING ON THE FORM.

SelectionChanged() : The user selects or unselects one or morerecords in the datasource.Enables youo to change the property values of control when the selected record changes.

ValidateWrite() : A new or updated record is to be written determines whether data is valid and ready to be written.

Write() : The user inserts a new record or updates an existing one.Calls the FormDataSource.validateWrite method and manages the database write operation.