- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-04-2019 04:02 PM
I have a notification script which uses template.print. On Dev, which I just cloned from production over the weekend, the email displays properly with the printed information. On production I get a cross scope error for "template". It was my understanding that "template" should be available from all scopes and my experience on Dev bears that out. Has anyone run into an issue like this and have a solution?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2019 09:20 AM
So it turned out that the issue was that the application scope wasn't enforcing cross scope privilege on Dev but was on Production. Since it wasn't enforcing it on Dev it didn't create cross scope privilege records as they were needed. So to fix it I needed to create a cross scope privilege record to access TemplatePrinter.print.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-04-2019 04:05 PM
What's error message you are getting for after calling email script?
Regards,
Sachin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-04-2019 04:07 PM
This is the full error that I'm getting.
com.glide.script.fencing.CrossScopeAccessNotAllowedException: Access to TemplatePrinter.print from scope scopeName not allowed
Caused by error in Email Script: 'test' at line 1==>
1: (function runMailScript(current, template, email, email_action, event) {
2: template.print('Hello World');
3: // Add your code here
4:

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-04-2019 08:58 PM
Please make sure that email notification and email script and email template scopes are same.
This is the issue.
Regards,
Sachin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-05-2019 07:46 AM
I created a new notification with nothing but a mail script to print hello world and it still gives me the scope error using template.print in the script. I checked and both the notification and the mail script are in the same scope for both my test notification and the original.