c/al code

I have made a zero price validate customization. When the price is zero an error will be thrown saying 'sales price not found'.The next item that I scan in the POS has the amount section zero. How can I make it go away? I have shared the screenshot with you guys.
below is my code.
code:
In pos trans line table
-Number on validate.
if price = 0 then error(text);





Answers

  • vaprogvaprog Posts: 927Member
    I guess the price field is initialized to 0. Unless you set it to some other value, and/or block insert and modify for records with price = 0, you will have records with price = 0 in your database.
    The error in the OnValidate trigger only reverts the value as it was before, and it does this only, if the user tries to enter the value 0. OnValidate is not a general condition, but only a check on edit.
Sign In or Register to comment.