Need to hide service portal menu based on logged in user and field value

Raviteja K
Tera Expert

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

find_real_file.png 

Thanks in advance

1 ACCEPTED SOLUTION

Raviteja

Please check your query because I have done same thing in my instance & it's working.

(Screenshot Attached).

View solution in original post

4 REPLIES 4

vidisha4
Giga Expert

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.

 

 

 

JavaScript parse error at line (1) column (27) problem = syntax error (<refname>; line 1)

 

error at var gr while declaring variable

Raviteja

Please check your query because I have done same thing in my instance & it's working.

(Screenshot Attached).

thank you, it is working. i kept brackets for the query