Is there a mechanism to check if a certain field has changed value in the OnDatabaseModify function of CU1?
There is no 'xRecRef' like there is in the OnDatabaseRename.
doesn't Change Log do exactly this? Why not quickly peek there?
In a nutshell: GET the record from the database, then compare it to the parameter. The one from the database is the old one, the one in the parameter the new one.
There is a hidden xRecRef in the OnDatabaseModify of Codeunit 1. If you add the parameter it will work as expected. This was fixed in KB374907 for NAV2015.
doesn't Change Log do exactly this? Why not quickly peek there?
In a nutshell: GET the record from the database, then compare it to the parameter. The one from the database is the old one, the one in the parameter the new one.
I would prefer not to do a GET while in the middle of a transaction for the same record. I can already see the locking nightmares
There is a hidden xRecRef in the OnDatabaseModify of Codeunit 1. If you add the parameter it will work as expected. This was fixed in KB374907 for NAV2015.
That would be awesome. I'm working with 2016RTM and the OnDatabaseModify does not have the xRecRef parameter. I'll add it tonight and let you know if it works in 2016.
Comments
doesn't Change Log do exactly this? Why not quickly peek there?
In a nutshell: GET the record from the database, then compare it to the parameter. The one from the database is the old one, the one in the parameter the new one.
I would prefer not to do a GET while in the middle of a transaction for the same record. I can already see the locking nightmares
That would be awesome. I'm working with 2016RTM and the OnDatabaseModify does not have the xRecRef parameter. I'll add it tonight and let you know if it works in 2016.
As I said, NAV standard Change Log does it this way.
Obviously, if you are able to get the same information as a parameter, all the better.