Showing Menu Items, if user Fullfills user Criteria
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2024 09:19 PM
I all, I have a query.
I want to make menu items visible if some user criteria is fulfilled. Suppose User Criteria is this:
I want this user criteria to work for this Menu Item also
But this condition type field is not working as expected. How Can I achieve this.
Kindly help
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2024 09:46 PM
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.
Regards,
Shloke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2024 09:50 PM
Hello @pandeyved ,
Add condition to Menu Item as follows:
(new sn_hr_core.hr_Criteria().evaluateById("87357af7dbbbd198de2ea8ebd3961901", gs.getUserID()))== true;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2024 11:00 PM
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2024 01:14 AM
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()