
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2024 06:37 AM - edited 04-17-2024 06:38 AM
I'm implementing below requirement but it's not happening.
In the user table, for every user records, we've an attribute called Business Unit which is a dropdown variable as per below screenshot -
So, if I'll create an incident or a service request, and if I put the caller name, then in backend it should validate, if the caller's Business Unit is Technology or Marketing, then the name should be appear in Blue color instead of regular black color. For others, it should be as it is like black color.
How I can implement this?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2024 03:18 AM - edited 04-19-2024 03:18 AM
I've updated the below code in Client script and it's working fine. Thanks for providing the required details. It's really helpful
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2024 06:45 AM
To achieve this, you need to create one on-change client script on incident table for field caller. In that script you have to use GlideAjax method which will call client callable script include. Pass the value of caller as one of the parameter.
You need to create one client callable script include, create one function which validates whether user has technology business unit or not by simply gliderecord on sys_user table.
Then, in client script use your response to highlight field. If response is yes then highlight caller field.
Ex : control.style = 'background-color: blue';
If response is not then in else part use,
control.style = 'background-color: black';
Please try to explore glideajax and script include concept at your own, this will help you to boost your knowledge in servicenow.
This will definitely helps you to resolved your issue. Let me know in case you need to understand the flow or you can DM on LinkedIn.
If this solution resolves your query, kindly mark it as the accepted solution and give it a thumbs up.
Best Regards,
Krushna Birla
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2024 06:54 AM - edited 04-17-2024 06:55 AM
For your reference, I quickly try to write code which you can refer
This will definitely helps you to resolved your issue. Let me know in case you need to understand the flow or you can DM on LinkedIn.
If this solution resolves your query, kindly mark it as the accepted solution and give it a thumbs up.
Best Regards,
Krushna Birla
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2024 01:12 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2024 05:01 AM
This error message got disappear. Because I've updated in the client script from ga.geXml to ga.getXML... However, there is no change in the color option in the caller field. I'm just providing the Script Include and OnChange Client Script as below -
Please let me know what I'm missing here.