Bumped by Community user
    Bumped by Community user
    Tweeted twitter.com/StackSharePoint/status/932918552058908673
    Bumped by Community user
    Bumped by Community user
    Bumped by Community user
    Bumped by Community user
    Bumped by Community user
    Bumped by Community user
    Bumped by Community user
4 replaced http://sharepoint.stackexchange.com/ with https://sharepoint.stackexchange.com/
source | link

I'm trying to retrieve the corresponding ListItem from a page layout in the master page gallery using JSOM. I'm using the same approach that Vadim provides in this question, JSOM - get listitem by file urlJSOM - get listitem by file url, as below:

function getAssociatedPageLayoutListItem() {
    var promiseObject = new RSVP.Promise(function (resolve, reject) {

        var pageLayoutListItem = web.getFileByServerRelativeUrl("/_catalogs/masterpage/MyCustomPageLayout.aspx");

        clientContext.load(pageLayoutListItem, 'ListItemAllFields');
        clientContext.executeQueryAsync(
            function () {
                resolve(pageLayoutListItem);
            },
            function (error) {
                reject(error);
            }
        );
    });

    return promiseObject;
}

The problem is that SharePoint returns an ArgumentException with the message Value does not fall within the expected range..

ErrorInfo
ErrorCode=-2147024809
ErrorMessage=Value does not fall within the expected range.
ErrorTypeName=System.ArgumentException
ErrorValue=(null)

I have run into this exception before, and back then it seemed as it had something to do with what fields I requested, but this time I can't seem to fix it. How can I get a clearer picture of what is missing, and how to fix it?

Update Loading only the requested file throws the same error.

It works perfectly when I use the REST-api and access the page layout and the ListItem for any given relative url and page.

Update 2 The desired method works on a specific site collection, but not on the root or another one. My biggest lead so far is to compare the site collections and see in what ways they differ. It might be due to access rights.

clientContext.load(pageLayoutListItem)

I'm trying to retrieve the corresponding ListItem from a page layout in the master page gallery using JSOM. I'm using the same approach that Vadim provides in this question, JSOM - get listitem by file url, as below:

function getAssociatedPageLayoutListItem() {
    var promiseObject = new RSVP.Promise(function (resolve, reject) {

        var pageLayoutListItem = web.getFileByServerRelativeUrl("/_catalogs/masterpage/MyCustomPageLayout.aspx");

        clientContext.load(pageLayoutListItem, 'ListItemAllFields');
        clientContext.executeQueryAsync(
            function () {
                resolve(pageLayoutListItem);
            },
            function (error) {
                reject(error);
            }
        );
    });

    return promiseObject;
}

The problem is that SharePoint returns an ArgumentException with the message Value does not fall within the expected range..

ErrorInfo
ErrorCode=-2147024809
ErrorMessage=Value does not fall within the expected range.
ErrorTypeName=System.ArgumentException
ErrorValue=(null)

I have run into this exception before, and back then it seemed as it had something to do with what fields I requested, but this time I can't seem to fix it. How can I get a clearer picture of what is missing, and how to fix it?

Update Loading only the requested file throws the same error.

It works perfectly when I use the REST-api and access the page layout and the ListItem for any given relative url and page.

Update 2 The desired method works on a specific site collection, but not on the root or another one. My biggest lead so far is to compare the site collections and see in what ways they differ. It might be due to access rights.

clientContext.load(pageLayoutListItem)

I'm trying to retrieve the corresponding ListItem from a page layout in the master page gallery using JSOM. I'm using the same approach that Vadim provides in this question, JSOM - get listitem by file url, as below:

function getAssociatedPageLayoutListItem() {
    var promiseObject = new RSVP.Promise(function (resolve, reject) {

        var pageLayoutListItem = web.getFileByServerRelativeUrl("/_catalogs/masterpage/MyCustomPageLayout.aspx");

        clientContext.load(pageLayoutListItem, 'ListItemAllFields');
        clientContext.executeQueryAsync(
            function () {
                resolve(pageLayoutListItem);
            },
            function (error) {
                reject(error);
            }
        );
    });

    return promiseObject;
}

The problem is that SharePoint returns an ArgumentException with the message Value does not fall within the expected range..

ErrorInfo
ErrorCode=-2147024809
ErrorMessage=Value does not fall within the expected range.
ErrorTypeName=System.ArgumentException
ErrorValue=(null)

I have run into this exception before, and back then it seemed as it had something to do with what fields I requested, but this time I can't seem to fix it. How can I get a clearer picture of what is missing, and how to fix it?

Update Loading only the requested file throws the same error.

It works perfectly when I use the REST-api and access the page layout and the ListItem for any given relative url and page.

Update 2 The desired method works on a specific site collection, but not on the root or another one. My biggest lead so far is to compare the site collections and see in what ways they differ. It might be due to access rights.

clientContext.load(pageLayoutListItem)
    Bumped by Community user
    Bumped by Community user
    Bumped by Community user
    Bumped by Community user
    Bumped by Community user
    Bumped by Community user
    Bumped by Community user
    Bumped by Community user
    Bumped by Community user
3 added 364 characters in body
source | link

I'm trying to retrieve the corresponding ListItem from a page layout in the master page gallery using JSOM. I'm using the same approach that Vadim provides in this question, JSOM - get listitem by file url, as below:

function getAssociatedPageLayoutListItem() {
    var promiseObject = new RSVP.Promise(function (resolve, reject) {

        var pageLayoutListItem = web.getFileByServerRelativeUrl("/_catalogs/masterpage/MyCustomPageLayout.aspx");

        clientContext.load(pageLayoutListItem, 'ListItemAllFields');
        clientContext.executeQueryAsync(
            function () {
                resolve(pageLayoutListItem);
            },
            function (error) {
                reject(error);
            }
        );
    });

    return promiseObject;
}

The problem is that SharePoint returns an ArgumentException with the message Value does not fall within the expected range..

ErrorInfo
ErrorCode=-2147024809
ErrorMessage=Value does not fall within the expected range.
ErrorTypeName=System.ArgumentException
ErrorValue=(null)

I have run into this exception before, and back then it seemed as it had something to do with what fields I requested, but this time I can't seem to fix it. How can I get a clearer picture of what is missing, and how to fix it?

Update Loading only the requested file throws the same error.

It works perfectly when I use the REST-api and access the page layout and the ListItem for any given relative url and page.

Update 2 The desired method works on a specific site collection, but not on the root or another one. My biggest lead so far is to compare the site collections and see in what ways they differ. It might be due to access rights.

clientContext.load(pageLayoutListItem)

I'm trying to retrieve the corresponding ListItem from a page layout in the master page gallery using JSOM. I'm using the same approach that Vadim provides in this question, JSOM - get listitem by file url, as below:

function getAssociatedPageLayoutListItem() {
    var promiseObject = new RSVP.Promise(function (resolve, reject) {

        var pageLayoutListItem = web.getFileByServerRelativeUrl("/_catalogs/masterpage/MyCustomPageLayout.aspx");

        clientContext.load(pageLayoutListItem, 'ListItemAllFields');
        clientContext.executeQueryAsync(
            function () {
                resolve(pageLayoutListItem);
            },
            function (error) {
                reject(error);
            }
        );
    });

    return promiseObject;
}

The problem is that SharePoint returns an ArgumentException with the message Value does not fall within the expected range..

ErrorInfo
ErrorCode=-2147024809
ErrorMessage=Value does not fall within the expected range.
ErrorTypeName=System.ArgumentException
ErrorValue=(null)

I have run into this exception before, and back then it seemed as it had something to do with what fields I requested, but this time I can't seem to fix it. How can I get a clearer picture of what is missing, and how to fix it?

Update Loading only the requested file throws the same error.

clientContext.load(pageLayoutListItem)

I'm trying to retrieve the corresponding ListItem from a page layout in the master page gallery using JSOM. I'm using the same approach that Vadim provides in this question, JSOM - get listitem by file url, as below:

function getAssociatedPageLayoutListItem() {
    var promiseObject = new RSVP.Promise(function (resolve, reject) {

        var pageLayoutListItem = web.getFileByServerRelativeUrl("/_catalogs/masterpage/MyCustomPageLayout.aspx");

        clientContext.load(pageLayoutListItem, 'ListItemAllFields');
        clientContext.executeQueryAsync(
            function () {
                resolve(pageLayoutListItem);
            },
            function (error) {
                reject(error);
            }
        );
    });

    return promiseObject;
}

The problem is that SharePoint returns an ArgumentException with the message Value does not fall within the expected range..

ErrorInfo
ErrorCode=-2147024809
ErrorMessage=Value does not fall within the expected range.
ErrorTypeName=System.ArgumentException
ErrorValue=(null)

I have run into this exception before, and back then it seemed as it had something to do with what fields I requested, but this time I can't seem to fix it. How can I get a clearer picture of what is missing, and how to fix it?

Update Loading only the requested file throws the same error.

It works perfectly when I use the REST-api and access the page layout and the ListItem for any given relative url and page.

Update 2 The desired method works on a specific site collection, but not on the root or another one. My biggest lead so far is to compare the site collections and see in what ways they differ. It might be due to access rights.

clientContext.load(pageLayoutListItem)
2 added 116 characters in body
source | link

I'm trying to retrieve the corresponding ListItem from a page layout in the master page gallery using JSOM. I'm using the same approach that Vadim provides in this question, JSOM - get listitem by file url, as below:

function getAssociatedPageLayoutListItem() {
    var promiseObject = new RSVP.Promise(function (resolve, reject) {

        var pageLayoutListItem = web.getFileByServerRelativeUrl("/_catalogs/masterpage/MyCustomPageLayout.aspx");

        clientContext.load(pageLayoutListItem, 'ListItemAllFields');
        clientContext.executeQueryAsync(
            function () {
                resolve(pageLayoutListItem);
            },
            function (error) {
                reject(error);
            }
        );
    });

    return promiseObject;
}

The problem is that SharePoint returns an ArgumentException with the message Value does not fall within the expected range..

ErrorInfo
ErrorCode=-2147024809
ErrorMessage=Value does not fall within the expected range.
ErrorTypeName=System.ArgumentException
ErrorValue=(null)

I have run into this exception before, and back then it seemed as it had something to do with what fields I requested, but this time I can't seem to fix it. How can I get a clearer picture of what is missing, and how to fix it?

Update Loading only the requested file throws the same error.

clientContext.load(pageLayoutListItem)

I'm trying to retrieve the corresponding ListItem from a page layout in the master page gallery using JSOM. I'm using the same approach that Vadim provides in this question, JSOM - get listitem by file url, as below:

function getAssociatedPageLayoutListItem() {
    var promiseObject = new RSVP.Promise(function (resolve, reject) {

        var pageLayoutListItem = web.getFileByServerRelativeUrl("/_catalogs/masterpage/MyCustomPageLayout.aspx");

        clientContext.load(pageLayoutListItem, 'ListItemAllFields');
        clientContext.executeQueryAsync(
            function () {
                resolve(pageLayoutListItem);
            },
            function (error) {
                reject(error);
            }
        );
    });

    return promiseObject;
}

The problem is that SharePoint returns an ArgumentException with the message Value does not fall within the expected range..

ErrorInfo
ErrorCode=-2147024809
ErrorMessage=Value does not fall within the expected range.
ErrorTypeName=System.ArgumentException
ErrorValue=(null)

I have run into this exception before, and back then it seemed as it had something to do with what fields I requested, but this time I can't seem to fix it. How can I get a clearer picture of what is missing, and how to fix it?

I'm trying to retrieve the corresponding ListItem from a page layout in the master page gallery using JSOM. I'm using the same approach that Vadim provides in this question, JSOM - get listitem by file url, as below:

function getAssociatedPageLayoutListItem() {
    var promiseObject = new RSVP.Promise(function (resolve, reject) {

        var pageLayoutListItem = web.getFileByServerRelativeUrl("/_catalogs/masterpage/MyCustomPageLayout.aspx");

        clientContext.load(pageLayoutListItem, 'ListItemAllFields');
        clientContext.executeQueryAsync(
            function () {
                resolve(pageLayoutListItem);
            },
            function (error) {
                reject(error);
            }
        );
    });

    return promiseObject;
}

The problem is that SharePoint returns an ArgumentException with the message Value does not fall within the expected range..

ErrorInfo
ErrorCode=-2147024809
ErrorMessage=Value does not fall within the expected range.
ErrorTypeName=System.ArgumentException
ErrorValue=(null)

I have run into this exception before, and back then it seemed as it had something to do with what fields I requested, but this time I can't seem to fix it. How can I get a clearer picture of what is missing, and how to fix it?

Update Loading only the requested file throws the same error.

clientContext.load(pageLayoutListItem)
1
source | link