Service portal terms & conditions

Jan Brani_
Tera Expert

On first login HR Portal, we need to make users accept terms and conditions.

My idea was to redirect user to some custom page with condition right after login and by clicking "Accept" on that page, field on user object will be changed to "confirmed". On next login there will be no redirection, because of this field.

My problem is that I don't where to set conditioned redirecting to another page right after login on <instancenumber>.service-now.com/hrsp

I saw this Legacy:Configuring the Login - ServiceNow Wiki   article, but it works only on normal login to servicenow, not if user is loging directly on portal page.

Anyone has any ideas how this could be done?

Thanks

4 REPLIES 4

michal29
Mega Guru

Hello Jan,



I know this may be a little overkill, but:


You could do an UI script that would check for example sys_user_preference to find id the user went trough the terms and conditions,


then once the user went trough, save true to the record.


Or even simpler -> put additional field on sys_user table and change that.


UI script can work globaly, so no worries here i guess.



Also, take a look at function gsftConfirm in the script includes in servicenow,


Alternatively here it is:



function gsftConfirm(title, question, onPromptSave, onPromptCancel, onPromptDiscard) {


      var width, dialogClass = GlideDialogWindow;


      if (window.GlideModal) {


              dialogClass = GlideModal;


              width = 400;


      }


      var dialog = new dialogClass('glide_confirm', false, width);


      dialog.setTitle(title);


      dialog.setPreference('title', question);


      dialog.setPreference('onPromptSave', onPromptSave);


      dialog.setPreference('onPromptCancel', onPromptCancel);


      dialog.setPreference('onPromptDiscard', onPromptDiscard);


      dialog.render();


}



You may want to use it for the prompt terms and condition.



Regards,


Michal


EDIT:



You could utilize the welcome message that is present on first users login:


More here, although its Fuji, I believe you can get the idea: Re: Hacking Fuji's "1st login info screens"


And look at Overview help in the navigation pane for details.


Also for that solution there is a record in sys_user_preference that is named overview_help introduction visited



Regards,


eric_hemmer
ServiceNow Employee
ServiceNow Employee

I was going to suggest Login Rules, but they are coverd in the WIki article referenced in the original post.   My idea was by checking a box on the user record (or chaning a user status field) when they acknowledge the waiver, you could force them to the first portal on 1st logon and then the 2nd portal thereafter.   But I also found this discussion, which describes another method as well.   Redirecting user logins - UI Scripts, Login Rules, or Installation Exits


Jan Brani_
Tera Expert

Ok so at the end we created widget on Portal index page which has onLoad function. That function checks whether user has atribute checked, if not, widget will redirect to blank page with only text on it. User will click on submit button and function switch atribute to true, so on next login widget won't redirect. It is not ideal, beacuse user can use upper panel to go somewhere else, but for us it is okay