Create a terms and condition dialog box after SP login

jcpasia
Kilo Contributor

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..

1 ACCEPTED SOLUTION

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

find_real_file.png

 

Go to homepage cltr+right on the home page as below and click on "Page designer"option

find_real_file.png

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.

find_real_file.png

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

View solution in original post

8 REPLIES 8

Jyoti8
Kilo Guru

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..!

jcpasia
Kilo Contributor

Hi @Jyoti Pagar 

 

Does the documentations provided work on Service Portals?

Yash Agrawal1
Tera Guru

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

Hi @Yash Agrawal 

 

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?