- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2024 10:22 PM
Hello Everyone,
I need a small requirement on UI action.
I need to display form button via UI action script or Client script if caller is in the given group. Although I create a new group.
My script:-
Thank You
Regards,
Suyash
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2024 10:25 PM
Please have a look on the below posts :
Thanks & Regards
Amit Verma
Please mark this response as correct and helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2024 09:41 PM
Hello,
Actually I need help in the condition
u_caller == gs.getUser().isMemberOf('openspace') || u_caller == gs.getUser().isMemberOf('software')
It was run but also run if condition is false.
Can you help me
Thanks and Regards
Suyash
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2024 10:40 PM
Can you please try with the below condition and check :
gs.getUser().isMemberOf('openspace') || gs.getUser().isMemberOf('software')
Thanks & Regards
Amit Verma
Please mark this response as correct and helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2024 10:46 PM
Hello,
my code is wasn't run actually the correct script is :-
u_caller == gs.getUser().isMemberOf('openspace') || u_caller == gs.getUser().isMemberOf('software')
But when condition is false it still display button
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2024 11:20 PM
Simply Changing the Condition on the UI Action to
gs.getUser().isMemberOf('openspace') || gs.getUser().isMemberOf('software')
should work. I just tested it on incident table by creating a simple save button. You can refer https://www.servicenow.com/community/developer-forum/syntax-for-a-condition-on-a-ui-action/m-p/22195... for more information.
Thanks & Regards
Amit Verma
Please mark this response as correct and helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2024 11:30 PM
Hell @Amit Verma Firstly I tried many time this code and without u_caller or caller_id it wouldn't run and after I correct your script logic it still give me the problem it run on both condition true or false.