Hi to all,
I'm using NAV 2017 and I'm trying to create simple example with OnBeforeItemModifyEvent. I have create CU, where I have created my function
LOCAL [EventSubscriber] BeforeItemModify(VAR Rec : Record Item;VAR xRec : Record Item;RunTrigger : Boolean)
Rec."Unit Price":=Rec."Unit Price"+1;
RunTrigger:=FALSE;
But I don't want Trigger that it is OnModify in T: Item to be executed. How I can skip that???
Any advice,
Thanks a lot,
0
Answers
It works just if I add code in T: Item onModify Trigger . But I don't want to change the onModify Trigger or I should must?? (Is there some another solution to skip the OnModify Trigger without changing Table)
OnModify()
MyPublishers.BeforeItemModify(Rec,xRec,SkipL);
IF SkipL=TRUE THEN EXIT;
SetLastDateTimeModified;
PlanningAssignment.ItemChange(Rec,xRec);
The OnModify is running and will not run again unless you call Modify(true).
You use RunTrigger to test and prevent loops.
IF NOT RunTrigger THEN
EXIT