We're reclaiming inactive PDIs to keep them available for active builders. Learn what's changing, who's affected, and how to protect your work. Read More

Color for alert message

Devika3
Tera Guru

Hi All,

Is there a way to show the alert message in red color using catalog client scripts.

Thanks in advance.

Regards,

Devika.

4 REPLIES 4

Not applicable

Hi @Devika ,

g_form.addErrorMessage('Your Error message will go here');

This should be enough.

Mark my answer correct & Helpful, if Applicable.

Thanks,

Sandeep

Hi Sandeep,

The alert should show the ok and cancel button. If we are using addErrorMessage we wont get that .

Thanks,

Devika.

Not applicable

Hi Devika,

Your original question was different.

Here you need a confirm box not alert. Create a on submit client script with your company condition and add the below sample script :

You may use the following onSubmit client script:

function onSubmit() {
    //Type appropriate comment here, and begin script below
      var myCompany = g_form.getValue('u_company');
     confirm("Your company is" + myCompany ", do you want to continue?");

}

Mark my answer correct & Helpful, if Applicable.

Thanks,

Sandeep

Tony Chatfield1
Kilo Patron

This post on ServiceNow Guru covers off the formats and colors of generic messages

https://servicenowguru.com/scripting/ui-info-error-message-cheat-sheet/