The CreatorCon Call for Content is officially open! Get started here.

Confirmation Dialog box - No alert - client script

Khanna Ji
Tera Guru

Hi All,

I have a catalog client script in which I am making Ajax calls to the Script Include. That script includes checks some data in the tables and returns the output to the client script. Now in the catalog client script, I have to show that response as a message box in the Service Portal.

I am able to show it as an alert statement but it looks really dirty. How can I generate a message box and show the content in it?

I found an article but I am not sure how to use them in client script - Link Here

Thank you, appreciate your response.

20 REPLIES 20

@ServiceNow User 

Did you follow all the steps such as importing the css, ui script etc

Regards
Ankur

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

Yash Agrawal1
Tera Guru

Hello,

You can show the messege,just below the field.and it is alternative of javascrip ALERT

using g_form.showFieldMsg('Messege you want to show here');

find_real_file.png

for more info,please check the below URL of servicenow official docs.it may suite to your reqirmet 

https://docs.servicenow.com/bundle/paris-application-development/page/script/useful-scripts/referenc...

 

If you feel the above content is good,then please mark my answer as CORRECT AND HELPFUL.

Regards

Yash Agrawal

 

 

 

It has to be a dialog message only as fieldMsg is not that catchy for user to view. Dialog box will gain the user attention.

 

I am not sure why is it that hard to show the message in the dialog box on the portal.

Hello User,

So if you are trying to do the samw using javascrit alert ,then whats wrong in it.

Did you try to use confirm dialog box,

it is same as alert dialog box .but in confirm dialog box, you will get button OK and CANCEL

Confirm, Alert - both statements look dirty. I want to show a message something like this on the catalog submission on the portal.

find_real_file.png