ACL based on field value
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-14-2024 04:35 AM
Hi,
I want to show the records if the user is a part of the auduience field. below code is not working.
var cd_Audience = new sn_cd.cd_Audience();
var visible = cd_Audience.isUserInAudience(current.u_audience, gs.getUserID()); // its checking if the loggedin user is belogs to audience field
//gs.addInfoMessage(visible);
visible;
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-14-2024 05:11 AM
is audience field a list type? if yes then simply do this
answer = current.u_audience.toString().indexOf(gs.getUserID()) > -1;
If my response helped please mark it correct and close the thread so that it benefits future readers.
Regards,
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader