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

Run AX report using X++

       Args                     args;      ReportRun          report;     salesLineProductPartProd salesLineProductPartProdLocal;     ;     ...