This short post is for you hardcore X++ developers that create magic everyday. D365 have the following method, that allows you to validate if any fields on a record have been changed. If it returns true, then something has changed, and if false, then nothing has been changed. There are scenario’s where you would like to know if there have been any changes to the record before you update/write to the Db, to save some roundtrips to the Db.
Then this is nice, and 100% std
Happy coding friends.
Or you could just use the following. It exists in the RetailTransactionServiceOrders class as an example.
I did not test it for all scenarios and field types though.
if (yourTable != yourTable.orig())
LikeLike
Great ! I have also experienced that the pmfTableHasChanged struggles on tables that are extended from another table. Like the DirPartyTable….
LikeLike
Doesn’t work for arrays, containers and GUIDs so should be used with caution
LikeLike