Display a messgae on load if requested for is a VIP user (need to be bold and italic)

cheerla Nithin1
Kilo Explorer

Hi All,

please help me on the above question by using business rule

10 REPLIES 10

@Arjit Gourav 

So what's the error and what's not working?

can you share?

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

@Ankur Bawiskar , The requirement was to show a message on top of the form if the VIP is mentioned in caller. But despite of writing this onLoad client script, it's not popping up the alert even when VIP user being selected in the 'caller_id' field 

@Arjit Gourav 

try this

function onLoad() {
//Type appropriate comment here, and begin script below
var jcheck = g_form.getReference('caller_id', callBackMethod);

}

function callBackMethod(jcheck){

if(jcheck.vip.toString() == 'true'){
alert('User is VIP');
}

}

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Thanks Ankur. But the alert is popping-up but after submission of the record. As the client script is onLoad, shouldn't it be the expectation for the alert to pop-up right after the field value is selected !!

Anirban Roy
Mega Guru

Hi,

 

You can use below method -

g_form.showFieldMsg('caller_id','VIP User');

find_real_file.png

g_form.showFieldMsg('caller_id','VIP User','error');

find_real_file.png

Regards,
Anirban