- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2018 12:11 AM
Hi
I am trying to hide a menu based on the logged in user and field value from user table.
If field value is true menu should be visible, but not able to achieve this since we need to glide and get that value.
How to write glide here
Thanks in advance
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2018 04:12 AM
Raviteja
Please check your query because I have done same thing in my instance & it's working.
(Screenshot Attached).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2018 03:08 AM
Hello Raviteja,
To hide service Portal Menu Item based on the condition, you should put query like below in the condition field:
var gr=new GlideRecord('sys_user'); gr.addQuery('sys_id',gs.getUserID()); gr.addQuery('company','86c1f3193790200044e0bfc8bcbe5d95'); gr.query();gr.hasNext()
OR
you can place your query in function in Script Include or in Global Business Rule & call that function in the condition.
condition: returnval() & returnval() function should return gr.hasNext() or !gr.hasNext() according to your requirement.
Thanks
Vidisha
I hope this help and if it does please mark it as helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2018 03:59 AM
JavaScript parse error at line (1) column (27) problem = syntax error (<refname>; line 1)
error at var gr while declaring variable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2018 04:12 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2018 04:51 AM
thank you, it is working. i kept brackets for the query