Can we display error message on Incident list view (listedit ACL), so that User can't leave field blank?

Rajanmehta
Mega Guru

Hello 

We are on Madrid version. Wanted to find out if it is possible to display error message when user tries to remove mandatory field on list view. We have ACL to restrict this mandatory field, but would like to display error message as well, if possible.

Please advise.

Thanks,

Rajan 

1 ACCEPTED SOLUTION

Hi Rajan,

So you can do this using before insert/update business rule with condition as below

use your field name here

current.<field> == ''

Script:

gs.addErrorMessage('Field <fieldName> cannot be left blank');

current.setAbortAction(true);

Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
Ankur

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

View solution in original post

10 REPLIES 10

Pratiksha Kalam
Kilo Sage

Hi,

we can show the error message on form but not on list.

 

Please refer below link to get more idea about it,

https://www.servicenowguru.com/scripting/business-rules-scripting/display-messages-ui-notification/

 

If my reply helps you at all, I’d really appreciate it if you click the Helpful button and if my reply is the answer you were looking for, it would be awesome if you could click both the Helpful and Accepted Solution buttons!

 

Regards,

Pratiksha

Thanks Pratiksha for your response. 

Yeah I agree with you, but wanted to find out if there is any workaround if anybody has found. 🙂 

 

Thanks,

Rajan 

Varsha Jadhav1
Giga Expert

Hello Rajan Mehta,

You can write before business rule..

suppose in incident form there is field priority.so the priority should be set according to impact and urgency.if we try to modify it directly from incident list view so it does not allow you to modify it.But no error message is given to the user.hence we can add error message in before business rule as follow: find the attachment..

hi Varsha,

 

Thanks for your response. What do you have on Action and Advanced tab on Business Rule? Can you please let me know? And is it working for list view?, because as far as I know, BR only works on forms.

 

Thanks,

Rajan