pdj's solution is one way to solve the issue, but it could lead to unexpected beheavior depending on the following code and from where the trigger is called from other objects.
I read somewhere that it is the behavior when the validation doesn't come from the form that bounds to the table. One workaround would be creating a custom OnModify(xrec) function and do your xrec vs rec validations in there.
So in
1. So your table's onModify trigger would call the custom OnModify(xrec) function when it needs comparison implicitly
2. And when xrec happens to be same as rec when it actually should not, you can call the Table.OnModify(xrec) function externally in your code by using a temp rec.
i've just met the issue and understood, that there are two events: OnBeforeModifyEvent, OnAfterModifyEvent (My problem appeared in subscriptions). So on OnAfterModifyEvent the situation is just like you described - the xRec is fully same with Rec. But on OnBeforeModifyEvent - everything is just on place. You would see xRec.Name as `''` and Rec.Name as `Name 1`
If you really want to check the changes use the subscriptions and OnBeforeModifyEvent. Tested on NAV2018
Comments
Just insert a xRec.FIND('=') in the beginning of the OnModify trigger.
Peter
This is expected beheavior. See online help:
http://msdn.microsoft.com/en-us/library ... 9(v=nav.70).aspx
pdj's solution is one way to solve the issue, but it could lead to unexpected beheavior depending on the following code and from where the trigger is called from other objects.
Further links:
http://dynamicsuser.net/forums/p/12614/61225.aspx
viewtopic.php?t=27859&f=23
viewtopic.php?f=23&t=41483&start=0
http://dynamicsuser.net/blogs/vanvugt/a ... ports.aspx
Best,
B.
So in
1. So your table's onModify trigger would call the custom OnModify(xrec) function when it needs comparison implicitly
2. And when xrec happens to be same as rec when it actually should not, you can call the Table.OnModify(xrec) function externally in your code by using a temp rec.
If you really want to check the changes use the subscriptions and OnBeforeModifyEvent. Tested on NAV2018