Showing Menu Items, if user Fullfills user Criteria

pandeyved
Tera Contributor

I all, I have a query. 
I want to make menu items visible if some user criteria is fulfilled. Suppose User Criteria is this:

pandeyved_0-1707196627098.png

I want this user criteria to work for this Menu Item also

pandeyved_1-1707196673690.png

But this condition type field is not working as expected. How Can I achieve this.
Kindly help

Thanks

4 REPLIES 4

shloke04
Kilo Patron

Hi @pandeyved ,

Conditions looks okay to me what you currently have on menu item. Couple of ways you can try debugging where the issue is:

1. Try running the same statement using gs.info(Same line which you have on your Menu item Condition); in background script and see if it gives you the desired result or not.

2. If it does not gives you then check on your Script include if that SI is accessible from all scopes or not assuming your menu item is in a different application scope to your script include.

 

Try and let me know. 

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

Unique45
Mega Sage

Hello @pandeyved ,

Add condition to Menu Item as follows:

(new sn_hr_core.hr_Criteria().evaluateById("87357af7dbbbd198de2ea8ebd3961901", gs.getUserID()))== true;

 

Please mark correct/helpful if this helps you!

Thanks @Unique45 

I want to accommodate three different condition like this, but due to length issue, it does not allow me, Can we do anyway other?

Unique45
Mega Sage

Hello @pandeyved ,

Create Script Include and add your condition there and return true/false value according to the that.

Call that script include in the condition like this :

javascript: new sn_csm_uni_th_data.testScriptInclude().testFunction()

 

Please mark correct/helpful if this helps you!