- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-03-2025 03:29 AM
Hello Developers,
I was trying the following script in background script
*********************
*** Script: User: MFD
*** Script: User has access to pm_project: undefined
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-04-2025 02:43 AM
the correct way to call is this, this worked for me
var answer = PPMRoleClassMapper.validateAccess(userGR, sysClass);
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-03-2025 04:35 AM
@Ankur Bawiskar I am calling the function correctly since it has 2 arguments - user and sysclass/table.
The function is doing what you have provided in your response.
I expect the function to pass value true or false when user is any user from my instance and table is 'pm_project'.
However I am getting an answer of "undefined"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-04-2025 02:43 AM
the correct way to call is this, this worked for me
var answer = PPMRoleClassMapper.validateAccess(userGR, sysClass);
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-04-2025 11:43 PM
Ok, thanks a lot for the correction.
The following line was culprit