Wednesday, January 23, 2019

orig() method in AX


Hi All,

There is a method named orig() in AX which refers to the last saved state of the current table buffer. The SalesTable form uses orig() method in lot of places in its datasource methods.You could find the code in the write method of the SalesTable datasource.

In the SalesLine DataSource under the SalesQty field you could find the following code in the modified() method.

if (salesLine.orig().SalesPrice!= salesLine.SalesPrice)
{
//some code here
}

In this case salesLine.orig().SalesPrice is the original (already saved)
price, while salesLine.salesPrice is the price that the user is attempting to modify.

2 comments:

D365 Extensions: Extend the validateField Method on a Table

In this post I will going to show you, how to extend the validateField method on a table. As example I used the SalesLine, where I will ...