
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2020 06:50 AM
Hi All,
I would like to seek assistance if anyone can provide a step by step procedure on how I can create a dialog box after logging in the instance? And after accepting the agreement, it stores my response in a specific table for auditing..
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2020 11:55 PM
Heelo JC
waiting for a response from your side.
you can also refer to the below screenshot
Please refer below screenshot for importing the attach widget code file on you instance table is sp_widget
Go to homepage cltr+right on the home page as below and click on "Page designer"option
On the right side of the form in the search box search widget name"One Time Popup"(name of the widget) drag and drop it to the home page as shown below.
After that save and do logout and then login again ..it will automatically popup just after login.
Please Mark it helpful/correct if my answer helps in any way to resolve
your query.
Reach out to me if any more help required.
Regards
Yash.K.Agrawal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2020 07:09 AM
Hi JC,
Refer below code and url :
https://docs.servicenow.com/bundle/geneva-servicenow-platform/page/script/client_scripts/reference/r_DisplayingACustomDialog.html
https://www.servicenowguru.com/system-ui/glidedialogwindow-advanced-popups-ui-pages/
https://www.jds.net.au/custom-glide-modal-dialog-boxes-in-servicenow/
function commentsDialog() { //Get the values to pass into the dialog var comments_text = g_form.getValue("comments"); var short_text = g_form.getValue("short_description"); //Initialize and open the dialog var dialog = new GlideDialogWindow("add_comments_dialog"); //Instantiate the dialog containing the UI page 'add_comments_dialog' dialog.setTitle("Add Task Comments"); //Set the dialog title dialog.setPreference("comments_text", comments_text); //Pass the comments into the dialog dialog.setPreference("short_text", short_text); //Pass in a short description for use in the dialog dialog.render(); //Open the dialog }
I hope it will help you.
Please mark helpful and Correct if it helps.
Thanks..!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2020 10:22 AM
Hi
Does the documentations provided work on Service Portals?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2020 07:22 AM
Hi JCpaisa,
Please add this widget into your ServiceNow instance. In the widget table.
and just add this, attachment in the widget table and then go to the portal and add this widget.
save it, that's it.
I tried on my instance, It is working fine.
Please refer the below screenshot.
Please Mark it helpful/correct if my answer helps in any way to resolve
your query.
Reach out to me if any more help required.
Regards
Yash.K.Agrawal

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2020 10:24 AM
Hi
Thank you for the information. Can you provide the steps on how to add this xml to the widgets?
In addition, may I know how I can change the close button to an "OK and Cancel" button? And the script to record the user's agreement of the T&C?