Security restricted: Read operation on table 'sn_hr_le_case' from scope 'Global' was denied.

GhitaB
Tera Contributor

Hi Everyone ! Actually i m facing a problem , i'm using a script include

var HRActivityMentionEmail = Class.create();
HRActivityMentionEmail.prototype = {
    initialize: function() {
    },
	getEmailValues: function(table, sysId) {
		var result = {};

		var recordGR = new GlideRecord(table);
		if (!recordGR.get(sysId))
			return;

		var displayValue = recordGR.getDisplayValue();
		result.subjectText = displayValue
			? displayValue
			: "a record discussion";
		var tableDisplay = recordGR.getClassDisplayValue();
		result.linkText = displayValue
			? "the " + tableDisplay  + " record " + displayValue
			: "this " + tableDisplay  + " record ";
		result.className = recordGR.getRecordClassName();
		result.recordSysId = recordGR.getUniqueValue();
		result.shortDesc = recordGR.getValue("short_description");;
        gs.log(JSON.stringify(result));
		return JSON.stringify(result);
	},

    type: 'HRActivityMentionEmail'
};

 

the issue i m facing is that in those script i want to get hr case info to display in the email it does work for hr lifrcycle cases but other sn_hr tables are readable only the le is not i tried multiple things but it didn t work 

 

note : both are in global scope i tried to make them in the HR core scope but it didn t work 

1 ACCEPTED SOLUTION

Sandeep Rajput
Tera Patron
Tera Patron

@GhitaB You need to create Application restricted caller access records in the Human resources: core scope to allow scripts from the global scope to access objects in the Human resources: core scope.

 

For more information please refer to, https://www.servicenow.com/docs/bundle/yokohama-application-development/page/build/applications/conc...

View solution in original post

3 REPLIES 3

Sandeep Rajput
Tera Patron
Tera Patron

@GhitaB You need to create Application restricted caller access records in the Human resources: core scope to allow scripts from the global scope to access objects in the Human resources: core scope.

 

For more information please refer to, https://www.servicenow.com/docs/bundle/yokohama-application-development/page/build/applications/conc...

@GhitaB Please mark the response an accepted solution if it addressed your question.

Ankur Bawiskar
Tera Patron
Tera Patron

@GhitaB 

HR lifecycle case table is in different scope.

But why not create the components in same scope?

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