- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2015 08:13 AM
Our end users will be primarily accessing our servicenow instance via our ESS portal.
On the ESS portal, there is a "My Profile" section which allows the user to change their language.
Initially, this works fine.
When happens next is that at some point a user finds them self on the main portal. Once on the main portal, the user then changes their language via the gear icon which creates a personal preference which now overrides the language in the "My Profile" area, rendering it meaningless.
What is the best way to prevent this, and ensure a consistent language setting via both ESS and the main portal?
Thanks,
- James
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2015 01:11 PM
Please disregard the earlier questions, I ended up fixing this via 1 business rule against the sys_user_preference table that will update the user's profile and cancel the attempt to create the user preference:
Name: Sync User Profile Language
Table: User Preference [sys_user_preference]
Advanced: yes
When: before
Insert: Yes
Update: Yes
Filter Conditions: When Name is "user.language"
Script:
function onBefore(current, previous) {
//Update the user's profile and block the creation of a user preference
gr = new GlideRecord('sys_user');
gr.addQuery('user_name',current.user.user_name);
gr.query();
while (gr.next()) {
gr.preferred_language = current.value;
gr.update();
}
current.setAbortAction(true);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2023 03:10 AM
This is not working on my side.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2020 08:59 AM
Hello James,
Did you try creating a business rule against user profile to update user.language in preference record?