Read operation on table 'sn_hr_core_case_talent_management' from scope 'Global' was denied. The appl
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-14-2024 08:16 AM
Hi All,
I have executed this below script in the Background scripts.
var sysid = '2963551097ef1990968dfee3a253af1a';
var gr = new GlideRecord('sys_audit');
gr.addEncodedQuery('tablename=sn_hr_core_case_talent_management^fieldname=state^oldvalue=24^ORnewvalue=24^documentkey='+sysid);
gr.orderByDesc('sys_created_on');
gr.query();
var c = 0;
var sec = 0;
while (gr.next()) {
if (c % 2 == 0) {
now = new GlideDateTime(gr.sys_created_on);
gs.info('poonam now' + now);
} else {
pre = new GlideDateTime(gr.sys_created_on);
gs.info('poonam pre' +pre);
var workTime = gs.dateDiff(pre, now, true);
sec += parseInt(workTime);
gs.info('poonam duration' +workTime);
}
c += 1;
}
gs.info('poonam sec' +sec);
var workDate = new Date(sec * 1000).toISOString();
var workDateString = workDate.substring(0, 19);
gs.info('poonam workdate' +workDateString);
var gr1 = new GlideRecord('sn_hr_core_case_talent_management');
gr1.addQuery('sys_id',sysid);
gr1.query();
if(gr1.next()){
gr1.setValue('u_hr_suspended_duration',workDateString);
gr1.update();
}
I got the output correct but the data is not updated in the given field and it shows this below error. I have allowed the RCAP errors and also created cross scope previllages
Can anyone please let me know what's the issue.
The actual requirement is -- I need the duration of the hr state choice "suspended" ( I would like to see for each HR case how long the ticket was in the suspended state and this is for the all active and Inactive cases. I have enabled the Field value duration for this table recently. As it not having the old cases data, I have written this Background script to calculate the state choice duration

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-14-2024 10:40 AM
@poornima batchu There are two ways to address this issue.
1. Create a fix script in the HR Core scope and execute your script through it.
OR
2. Update your RCAP records and choose the Source Scope as Global and Target Scope as Human Resource Core for both Read and Write operations.
Hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-14-2024 11:37 AM
The error message clearly indicates that the operation is not allowed by cross-scope privileges. In your screenshots, Global is selected as the target scope, but if I understand correctly, you are running a script in Global to update HR cases, which means Global is the source scope.
Blog: https://sys.properties | Telegram: https://t.me/sys_properties | LinkedIn: https://www.linkedin.com/in/slava-savitsky/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-14-2024 11:19 PM
Initially, I have tried Global in Source scope but it says invalid insert

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2024 04:31 AM
@poornima batchu You tried to create a record in Global scope which is incorrect. Create the same record in Human Resource Core scope with following values populated.
1. Source Scope: Global
2, Target Scope: Human Resource Core
3. Application: Human Resource Core
4. Target Name: sn_hr_core_case_talent_management
5. Type: Table
6. Operation: Read
7. Status: Allowed