dialog window in client script - alternative for service portal needed

LG2
Mega Expert

Hi,

we have a client script which opens a new window for some terms and conditions acknowledgement which is not working for the Service Portal.

Ihave found other references which relate to a widget but the ts&cs only need to appear under certain circumstances (which is controlled by a - working - UI script).

here is our script (which runs on all UIs) - can anyone suggest what we need to change please so that it will run on all UIs?

thanks in advance!

 

function onChange(control, oldValue, newValue, isLoading) {
   if( newValue == 'agree'){
      var dialog = new GlideDialogWindow('terms_and_conditions_dialog'); //Render the dialog containing the UI Page 'terms_and_conditions_dialog'
   dialog.setTitle('Terms and Conditions'); //Set the dialog title
   dialog.setSize(600,600); //Set the dialog size
   dialog.removeCloseDecoration(); //Remove the dialog close icon
   dialog.setPreference('cancel_url', 'catalog_home.do?sysparm_view=catalog_default'); //Set optional cancel redirect URL
   dialog.render(); //Open the dialog
   }
}

1 ACCEPTED SOLUTION

LG2
Mega Expert

In the end we put the ts&cs into a macro with label variable and embedded them into a widget for the Service Portal with a variable width specified for the display. Not perfect, but the ts&cs are at least visible now.

View solution in original post

11 REPLIES 11

Alas, we ended up dropping the pop up window completely - we now just have a macro variable within the catalog item and have the html in the widget, so not really the equivalent, but sufficient for what we needed to do (which was display the ts&cs). 

Did you manage to find solution now to display dialog box on the portal?