tiagomacul
Giga Sage

How to create a number type field as a variable in a catalog item?

 

Como criar variável somente números no catálogo?

 

01. 

Navigate > Service Catalog > Variables Sets

find_real_file.png

02.

Select your variable set / Selecione o Variable set desejado

find_real_file.png

 

03.

Click New / Clique em "New"

find_real_file.png

 

04.

Name: Type your own name

Type: Select "onChange"

variable name: Select your own variable

find_real_file.png

 

05.

On script field copy and paste

function onChange(control, oldValue, newValue, isLoading) {

   if(isLoading || newValue == ''){

           return;

   }

var pattern = /^[0-9]*$/;

     if(!pattern.test(newValue)){
	

           //alert('Please enter only numbers!');
           alert('Por favor informe apenas números no centro de custo!');
           g_form.setValue('centro_custo', '');

   }

}

 

.

 

 

Version history
Last update:
‎10-16-2018 11:01 AM
Updated by: