Skip to main content

Hello ,

 

I have created a custom field but I need it to be an integer>0 .

Does anyone have an idea how to achieve it.

 

Thank you in advance,

Hanane

Hi @Hanane 

Set the data type to number format. 

I believe you will have to recreate as you cant change the data type after the custom field is created.


I agree with @EntNadeeL .

Set it during the creation to “Number”.

 


Hello ,

Thank you both for your responses , but my field is already a number (unformatted) .

Still I can enter decimal numbers and zeros in my field ( thing that I want to avoid ) .

 

 

 


Hello @Hanane 

is that a persistant or a read only ?

By your last screenshot you shared, I suppose it’s a persistant one.

In that case, I guess you won’t have any other solution than to create a custom event, in which you might correct the value of your CF


Hi @Hanane 

As @romsar mentioned here, create an event to _CFT table to validate the input of the field.

Code would be something simple similar to below.

DECLARE

BEGIN

IF (NEW:$field_value) < 0 or INSTR(to_char(2.0), '.', 1, 1)>0 THEN 

‘Error msg’

END 


the code woud be more like this :

BEGIN

  IF FLOOR(&NEW:COUNT)!=CEIL(&NEW:COUNT) THEN

      --display an error message

  END IF;

END;


Thank you all , but my managers try to avoid custom events , is there any way to do it beside the customization ? 


Reply