- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2023 12:11 AM
Hi All,
How to hide this widget to specific users. From the customer_contact table, only users with no value on the LDAP server field should be able to access the menu item.
Restriction via role is not an option because some users, for example, have snc_internal role but have LDAP server value. Thank you.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2023 01:41 AM
Yes, to call a Script Include in your condition field you need to write below in your Condition field:
new getLDAP().getValue();
- You don't need to write javascript before above statement as it is already evaluated as JS.
- getLDAP() is the name of script inculde. You can change it to whatever your script include name is.
- getValue() is the function that you will create inside the Script Include.
Again, if my answer helps then please mark it Helpful or Correct!
Thanks,
Utpal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2023 03:06 AM
Your hasAccess() method has a parameter in Script Include but you are not passing any parameter when you're calling this function in condition field. I think you want to pass logged in user sys_id here and to do that you need to write hasAccess(gs.getUserID();
Also, your return statement of SI is wrong. You should return a string value always!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2023 12:22 AM
Hi @Utpal Dutta, I was able to make it work. I appreciate your assistance. Thank you very much.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2023 06:39 AM
Please mark my answer Helpful & Correct so that it helps other community members to find correct answers of the related issue.
Thanks,
Utpal