- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2022 07:40 AM
We have a requirement to highlight the VIP users in interaction table in Agent Workspace in form view in servicenow.
Let me know if anyone have any idea on how we can implement that.
I have implemented it in incident and interaction table using the client script and style but not in Agent workspace view.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2022 12:20 PM
Most likely the code you are using on the client script is not good for the workspace environment.
This code works on all environments.
function onChange(control, oldValue, newValue, isLoading) {
if (!g_form.hasField('opened_for'))
return;
if (!newValue)
return;
g_form.getReference('opened_for', ref);
function ref(user) {
if (user.vip == 'true')
g_form.showFieldMsg('opened_for', 'This is a VIP user', 'error');
}
}
If I helped you with your case, please click the Thumb Icon and mark as Correct.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2022 12:20 PM
Most likely the code you are using on the client script is not good for the workspace environment.
This code works on all environments.
function onChange(control, oldValue, newValue, isLoading) {
if (!g_form.hasField('opened_for'))
return;
if (!newValue)
return;
g_form.getReference('opened_for', ref);
function ref(user) {
if (user.vip == 'true')
g_form.showFieldMsg('opened_for', 'This is a VIP user', 'error');
}
}
If I helped you with your case, please click the Thumb Icon and mark as Correct.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2022 05:09 AM
Hi @Sebas Di Loreto ,
It is working very fine in Agent workspace but now I am also getting it as an error for the form view when I was not using the Agent workspace.
Is there any further changes that we can do to remove this and only reflect in Agent workspace.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2022 11:08 AM - edited 12-09-2022 11:09 AM
I added this client script on my dev instance and it worked fine on both interfaces, workspace and platform. I attached the xml you can import into the interaction table.
This is how it shows on the platform UI
This is how the same interaction shows on the workspace UI
If you noticed, the client script UI type is ALL. If you want it to apply only to the platform UI then make it Desktop. If you want it on workspace make it Mobile/Service Portal
If I helped you with your case, please click the Thumb Icon and mark as Correct.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2022 03:40 AM
Hi @Sebas Di Loreto ,
Thankyou for the solution.
It is working for me for both platform ui and workspace ui but is there a way in which we can reflect this vip only in workspace ui and remove it from platform ui.