My SharePoint 2013 App has a button with the click Event:


where OpenDialog is defined the following way:

 function OpenDialog(URL) {

    var options = {  url:URL, width: 600, height: 500, showClose: true, allowMaximize: true   };

The problem is, I get an Access Denied error when debugging, or without debugging the following screen:

Dialog Error

When I click on the provided link, titled with "Open this content in a new window" the dialog is shown in a new window. But I want it to be opened as Dialog within my App.

Do I need to give some more permissions to the app or to any other part of it? What am I missing out?


Just in case of missing permissions I tried the following:

    <AppPermissionRequest Scope="http://sharepoint/content/sitecollection/web" Right="FullControl" />
    <AppPermissionRequest Scope="http://sharepoint/content/sitecollection" Right="FullControl" />
    <AppPermissionRequest Scope="http://sharepoint/projectserver" Right="Manage" />
    <AppPermissionRequest Scope="http://sharepoint/projectserver/enterpriseresources" Right="Write" />
    <AppPermissionRequest Scope="http://sharepoint/content/sitecollection/web/list" Right="FullControl" />
    <AppPermissionRequest Scope="http://sharepoint/content/tenant" Right="FullControl" />
    <AppPermissionRequest Scope="http://sharepoint/projectserver/workflow" Right="Elevate" />

Still no progress. I can't open the NewForm.aspx in a model dialog.


There is something I didn't notice. The List I want to get access to is not provided by the App but by the Site Collection. So I want to access a List outside of the App Scope


In a blog I found a post where somebody had to include SP.js, SP.Core.js and SP.UI.Dialog.js into the aspx that called the modal dialog.

At this point I didn't include SP.Core.js and after including it the access denied errors are gone BUT:

I get new errors: Error in sp.ui.dialog.js JavaScript runtime error: Unable to get property 'setInnerText' of undefined or null reference

It looks like something isn't initialized at this point.

Second, I've changed my dialog calling function because SharePoint provides one already. Nevertheless with SharePoints function and with my function the errors occur (access denied without sp.core.js and the above one with sp.core.js)

The new calling function is:

 function OpenDialog() {
    var url = "/Lists/ListName/NewForm.aspx";
    var options = {  url:url, width: 600, height: 500, showClose: true, allowMaximize: true   };



I also tried to run the command with ExecuteOrDelayUntilScriptLoaded(func, script) to ensure all background stuff is loaded correctly. Still got the error.

Should I use SP.Core.js and try to get rid of this error? Or is it better to try to get rid of the access denied error without the SP.Core.js? And how would I be able to get the Dialog running?

  • Maybe not relevant anymore but try checking in your master pages. That was our issue.
    – user39157
    Jan 29, 2015 at 15:58

2 Answers 2


check proper app permissions is given.

  <AppPermissionRequest Scope="http://sharepoint/content/sitecollection" Right="FullControl" />

as well if you are using SharePoint Hosted app, try the following example.



  • I didn't have the sitecollection permissions. But with FullControl it doesn't work, too. I don't really understand the social.technet link stuff. and the msdn code is interesting but I can't figure out what I am missing in my project with this code. Probably it's something simple, yet hard to find.
    – Loki
    Jan 7, 2014 at 11:47
  • There is something I didn't notice. The List I want to get access to is not provided by the App but by the Site Collection. So I want to access a List outside of the App Scope
    – Loki
    Jan 7, 2014 at 12:41

try putting the full URL? by putting "/Lists/xxx", this is assuming that your list is also lies within the same web or same domain.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.