Ax SalesPrice Validation

when i select the item in salesorder form in Lines, the salesprice we get automatically in the form.(if we do setup in itemmaster related item price(Tab))

here i want to do the validation as the salesprice can be changed to (value +2) or (Value - 2).

if he enter more or less eg: as value +3 or value - 3 it should throw warning message

the code i have written in SalesLineType classes , validatefield method.

case fieldnum(SalesLine, SalesPrice) :

if ((SalesLine.SalesPrice > saleslinepr.SalesPrice +2) || (SalesLine.SalesPrice < saleslinepr.SalesPrice -2))


ok = ok && SalesLine.SalesPrice == (SalesLine.SalesPrice<=saleslinepr.SalesPrice+2);



but here i cannot get value as value+1 or value +2 as my condition.

if i change the value, the value is automatically to exist value. eg if saleprice is 70 if i change it to 72 its automatically changing to 70.

plz help meā€¦Thanks in adavnce to all, gud day