When switching language in the portal the language should get updated in user profile as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2023 12:19 AM
When switching language in the portal the language field should get updated in user profile as well. How can we achieve this
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2023 03:39 AM
Hello @Akula M S G Dev
Changing the language changes the user preference.
You can write insert/update Business Rule on User Preference table. (When the name is user.language)
(function executeRule(current, previous) {
//Update the user's profile language based on 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, previous);
Please mark the answer as correct solution and helpful if helped.
Kind Regards,
Ravi Chanda