Remove or edite the default error message

kerolos samir
ServiceNow Employee
ServiceNow Employee

Hi team 
Is there any way to modify this error message in the screen 
Or remove it and show another one with a client script 

17 REPLIES 17

to be honest i don't know what is OOB 
but this is our function , when i view it in the UI builder it lead me to this page 

It also has the issue 
so i think the soluion that i provided is solving the problem partially 

This is a integer field on some table. You should try this for now:

 

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
if (!Number(newValue) || !Number(oldValue)) {
var msg = "Maximum waiting time should be Number " + newValue;
g_form.hideErrorBox('max_waiting_time');
g_form.showErrorBox('max_waiting_time', msg);
}
}

 

You can refer https://www.servicenow.com/community/developer-forum/how-to-use-getmessage-quot-message-key-quot-in-...  for dynamic newValue.

 

Also, add the key of your getMessage in the "Message" field on your client script. If this field is not on form use list view on client script to update this.


Raghav
MVP 2023

@kerolos samir Did this work?


Raghav
MVP 2023

Sorry for late reply 
it doesn't work , i don't know why and it's the same functionality as my code that flicker the massage 

but the solution that i provided works partially as i said it hide the original massage and show the new one 

and we took another direction with the business 

Thanks for you help man