Wednesday, 29 September 2021

Setting default field value in AX

Using table initValue() we can set default values of any table field during creating a new record. This can also be done on a form level so that the value will only be set for the specific form. Here is the example, let's suppose the table is yourTable and fields are currentDate, YourField

public void initValue() { super(); // setting current date time yourTable.currentDate = this.Now();

//setting any default value yourTable.YourField = "Default value";

}

No comments:

Post a Comment

Difference Between Edit And Display Method in Ax

Display Method: The display method means that the method’s return value is being displayed on a form or a report.  This value is fixed and c...