Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Show field message when check box is true in catalog item

VISWANATH KAMAL
Tera Contributor

I need a field message for a check box,if the checkbox is true in catalog item it should show a field message. Can anyone suggest how to achieve this?

3 REPLIES 3

Ravi Chandra_K
Kilo Patron
Kilo Patron

Hi @VISWANATH KAMAL 

Greetings!

you can write on change on checkbox variable.

 

function onChange(control, oldValue, newValue, isLoading) {
 
var message = 'Your message here';
g_form.showFieldMsg('variableName', message,'info');
 
}

Please hit the thumb and Mark as correct based on Impact!!

 

Kind Regards,

Ravi Chandra.

Kiran_45
Giga Guru

Hi @VISWANATH KAMAL ,
Use the below code in catalog client script

if (newValue == 'true') {
        g_form.showFieldMsg('Field_Name', "Message", 'info');
    }

 

Regards,

Kiran

Samaksh Wani
Giga Sage

Hello @VISWANATH KAMAL 

 

 

var msg = "type ur msg";
var check = g_form.getValue('check_box_field_name')
if(check == 'true'){
g_form.showFieldMessage('check_box_field_name', msg, 'info');
}

 

 

 

Plz Mark my Solution as Accept and Give me thumbs up, if you find it Helpful.

 

Regards,

Samaksh