Proplem in my dataset modify method !

Dear all

I’m a new developer for AX

and in my dataset I right this code

public void modified()
{
if(attendance.LeaveTime < attendance.AttendTime)
{
info(“Error…Leave time not accepted !”);
// box::stop(“Error”,“Error title”,“OK”);
}
else
{
super();
}
}

When I make modify for this field

that I want to check the leave time > attend time

the error is displaying but the modifing is going on

so how to show the error and stop the update action ?