Display Method

Today I will demonstrate you that how to use Display Method in AX 2012.

Steps to Create Table with field Basic, PF and HRA:
  1. Create a Table with name "Salary Details" with three fields: Basic, HRA and PF.
  2. Create a display method in the table with following code:-
              display int CalculateSum()
                 {
                     return this.Basic+this.PF+this.HRA;
                   }

Steps to Create Form:

  1.  Create a form and give reference of above created table as its data source.
  2. Add two controls of type IntEdit by right clicking on Design tab.
  3. Change two properties, DataSource and DataField.
  4. Add another control of same type and change DataSource and Datamethod prperty. 
  5. Set Datamethod property as CalculateSum.
  6. Save the form and Run.

Happy Daxing.. :)


Comments