Skip to main content
Solved

Negative number in custom field

  • November 29, 2021
  • 1 reply
  • 173 views

jporter
Sidekick (Partner)
Forum|alt.badge.img+10

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

Best answer by Kasun Balasooriya

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

This topic has been closed for replies.

1 reply

Kasun Balasooriya
Superhero (Employee)
Forum|alt.badge.img+20
  • Superhero (Employee)
  • Answer
  • November 29, 2021

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