- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2023 05:04 AM
Hi Team ,
Am using UI action to show button to incident manger and admin based on three condition
1. u_error_processing== true than show button only incident_manger
2. if u_count=4 than show only to admin
3.if u_error_processing== true and if u_count=4 than show only to admin
below is my condition :
current.u_error_processing== true && gs.hasRole('incident_manger') && current.u_count== '4' && gs.hasRole('admin')
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2023 06:45 PM
just like the normal case
new scriptIncludeName().functionName(current)
In that script include function you can add those conditions using current object and return true/false
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2023 06:45 PM
just like the normal case
new scriptIncludeName().functionName(current)
In that script include function you can add those conditions using current object and return true/false
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2023 11:43 PM - edited 02-06-2023 11:46 PM
@Ankur Bawiskar
I have a similar requirement and i am trying the way u suggested but somehow the current object fields are all coming up empty in the script include . Not sure what to do . The script in not client callable.
Any suggestions would be greatly helpful .thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2023 12:23 AM
script include may not be client callable that should not be an issue
pass current object in that function
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2023 12:26 AM
@Ankur , trying the same
new RestrictPartsActionsUtil().checkStartWorkAccess(current)==true
But all the field values of this current object are coming as undefined (even the referenced field).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2023 07:15 AM
Hi @String , your condition should be like below.
(current.u_error_processing == 'true' && gs.hasRole('incident_manager')) || (current.u_count == '4' && gs.hasRole('admin')) || (current.u_error_processing == 'true' && current.u_count == '4' && gs.hasRole('incident_manager'))
As already suggested by Ankur, please use script include to store the condition and try to use condition by condition check if it is not working.
Best Regards,
Mani