Hi guys, I have just checked it in NAV 2017 and works fine, so xRec is different from Rec. For both OnBeforeModifyEvent and OnAfterModifyEvent.
I have tested with the following code:
OBJECT Codeunit 88889 Update Item
{
OBJECT-PROPERTIES
{
Date=16-06-17;
Time=09:16:42;
Version List=OnBeforeModifyEvent - xRec;
}
PROPERTIES
{
OnRun=BEGIN
UpdateDescriptionAssigment;
UpdateDescriptionValidate;
END;
}
CODE
{
VAR
Item@1000 : Record 27;
LOCAL PROCEDURE UpdateDescriptionAssigment@1();
BEGIN
WITH Item DO BEGIN
GET('1000');
Description := 'Bicycle UpdateDescriptionAssigment';
VALIDATE(Description);
END
END;
LOCAL PROCEDURE UpdateDescriptionValidate@2();
BEGIN
WITH Item DO BEGIN
GET('1000');
VALIDATE(Description,'Bicycle UpdateDescriptionValidate');
END
END;
BEGIN
END.
}
}
OBJECT Codeunit 88888 Item - Events
{
OBJECT-PROPERTIES
{
Date=16-06-17;
Time=08:42:12;
Version List=OnBeforeModifyEvent - xRec;
}
PROPERTIES
{
OnRun=BEGIN
END;
}
CODE
{
[EventSubscriber(Table,27,OnBeforeValidateEvent,Description)]
LOCAL PROCEDURE BeforeOnValidateDescription@1(VAR Rec@1000 : Record 27;VAR xRec@1001 : Record 27;CurrFieldNo@1002 : Integer);
BEGIN
MESSAGE('BeforeOnValidateDescription')
END;
[EventSubscriber(Table,27,OnAfterValidateEvent,Description)]
LOCAL PROCEDURE AfterOnValidateDescription@2(VAR Rec@1000 : Record 27;VAR xRec@1001 : Record 27;CurrFieldNo@1002 : Integer);
BEGIN
MESSAGE('AfterOnValidateDescription')
END;
BEGIN
END.
}
}