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.

How to show an Error Message on the Workspace within g_modal dialog box?

Himesh Murthy
Tera Contributor

Hello,

 

I have a requirement of showing an error message within the workspace of g_modal dialog box (based on a condition) as shown in the snapshot below

 

HimeshMurthy_0-1679391811821.png

Can anyone help me get this achieved please? Thanks

 

Regards,

Himesh

 

 

2 REPLIES 2

Sharan Ellendul
Tera Contributor

Hi @Himesh Murthy 

 

Did you get any solution for this?

vishwajeet5550
Mega Guru

create and customize a modal dialog, and you can add an error message to the content of that modal.

You can use g_modal to create a dialog and show it in the workspace. 

To show an error message inside the modal.

you can set the content display a specific error message


var modal = new GlideModal('error_modal');
modal.setTitle('Error');
modal.setBody('{div style="color: red;"}Please try again later.{/div}', false);//Curly braces replace with trangle braket
modal.addCloseButton('Close');
modal.render();