how set default homepage for select users depends upon rules
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2017 09:43 AM
i have created one homepage i want to set as a default for user has speccific role...can i use fix script..kindly suppest me

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2017 09:54 AM
A users current home page is a user preference if memory serves so you can just run a script to add/update the preference to the users who have the role. You should probably set the read role for the home page also if you do not want others to see it.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2017 09:54 AM
You can use a Fix Script for this purpose as long as you are not wanting it to proactively change users homepages on the fly. The Fix Script runs at a point in time.
Hompages are set per-user using a User Preference. If you want to change them, you would have a Fix Script run a GlideRecord on the sys_user_preference and use a query like "User preferences called homepage, for users that have role itil". It looks like the screenshot I included. You would then tell the GlideRecord to update each record in the result to the sys_id of whatever homepage you want to set these users to. I included an untested sample script as an example of one way you could do this.
var prefs = new GlideRecord('sys_user_preference');
prefs.addQuery('name', 'homepage').addCondition('user.roles', 'admin');
prefs.query();
prefs.setValue('name', sys_id_of_new_homepage_here); //put your new homepage's sys_id here
prefs.updateMultiple();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2017 10:03 AM
hi pratrick,
i am little bit confusion shall i write script in fixscript or user preference table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2017 10:52 AM
var prefs = new GlideRecord('sys_user_preference');
prefs.addQuery("name","IncidentReports").addCondition('user.roles', 'rk');
prefs.query();
prefs.setValue('name',"d99e496cdbcdb200f257ddd0cf961966"); //put your new homepage's sys_id here
prefs.updateMultiple();