SNC not defined in scope app

Art Supsiri1
Tera Contributor

I am using the following snippet to initiate the creation of a survey instance:

new SNC.AssessmentCreation().addRecentAssessor(new_user);
	
	var instanceId = "";
	if (type_id != "" && source_id != "") //This is an assessable record
		instanceId = new SNC.AssessmentCreation().createAssessments(type_id, source_id, new_user);
	else    // This is a survey or a metric type
	    instanceId = new SNC.AssessmentCreation().createAssessments(asmtr_sys_id, "", new_user);

This works in Global scope, but in my scoped app, i get an error:

java.lang.SecurityException: Invalid object in scoped script: [object SNC]

I've tried to append a global. prefix so it looks looks like global.SNC, but I still get the same error.

Any ideas? Thanks!

2 REPLIES 2

Raj68
Mega Guru

Hi,

hope below link will help you in doubt:

https://community.servicenow.com/community?id=community_question&sys_id=3451d32ddbdcdbc01dcaf3231f961975

https://community.servicenow.com/community/hr/Machine%20generated%20alternative%20text:%20Entry%20%20Column%20nam8%20%20Max%20lengthL%20%20Reference%20typ8%20%20Choic8%20%20Required%20field%20%20Change%20Request%20(change%20requestl%20%20u%20reminder%20%20Date/community?id=community_question&sys_id=3a82b6fedbb26b80f0612183ca961959

NOTE: Mark correct or helpful if it helps you.

 Warm Regards,

Raj patel

 

Hi Raj,

Good thinking, but I don't believe the SNC script include is visible or can be altered in any way. It's a core ServiceNow script.