Client Script not working in Workspace
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-12-2023 10:42 PM
g_form.getDisplayBox('opened_for').style.color = 'red';
The above script is working in platform but not working in workspace.
I am writing some alerts and these alerts are coming in the workspace also but not setting the color.
if (user.vip == true || user.vip == 'true')
{
alert("inside = vip");
g_form.getDisplayBox('opened_for').style.color = 'red';
}
else if(user.u_exec == true || user.u_exec == 'true')
{
alert("inside - exec");
g_form.getDisplayBox('opened_for').style.color = 'purple';
}
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2023 05:26 AM
If you want it on workspace make UI type as it Mobile/Service Portal. try below code
function onChange(control, oldValue, newValue, isLoading) {
if (!g_form.hasField('opened_for'))
return;
if (!newValue)
return;
g_form.getReference('opened_for', VIPUser);
function VIPUser(user) {
if (user.vip == 'true')
g_form.showFieldMsg('opened_for', 'This is a VIP user', 'error');
}
}
If that helps please mark my answer as correct / helpful!
Regards,
Yaswanthi