General X++ Development

How do I detect if a field changed in X++?

Asked by Sunny Vasty· Aug 13, 2026· 1 answers

How do I detect if a field changed in X++?

SSunny Vasty75 reputation · answered Aug 13, 2026

Compare the current value to orig().

X++
MyTable original = myTable.orig();

if (original.MyField != myTable.MyField)
{
    info('Field changed.');
}

If you already have the original buffer, do not run another database select just to figure out what the old value was.