Solved

Negative number in custom field

  • 29 November 2021
  • 1 reply
  • 132 views

Userlevel 5
Badge +10

Is it possible to restrict a number custom field to not accept negative numbers?

icon

Best answer by Kasun Balasooriya 29 November 2021, 23:35

View original

This topic has been closed for comments

1 reply

Userlevel 7
Badge +20

Hi,

You should be able to do this by defining a custom event for insert/update on the custom field. 

Edit: 

Here’s a sample online sql to check for negative values: 

BEGIN

IF (&NEW:CF$_TEST2 < 0 ) THEN

IFSAPP.ERROR_SYS.Record_General('CustomerOrder','The input value cant be negative. Please adjust the value entered before saving.');

END IF;

END;

Thanks,

Kasun