I've got a pretty weird issue going on on a clients SharePoint 2013 environment. We're using some JSOM javascript code to retrieve details from a web. Here is a snippet of the code:

function getSiteProperties() {
    var deferred = $.Deferred();

    var ctx = SP.ClientContext.get_current();
    var web = ctx.get_web();
    var siteProps = web.get_allProperties();
    var user = web.get_currentUser();

    var ob = new SP.BasePermissions();
    var hasPermissions = web.doesUserHavePermissions(ob)


        function () {
            deferred.resolve(siteProps, user.get_isSiteAdmin(), hasPermissions.get_value());
        function (sender, args) {
            deferred.reject(sender, args);

    return deferred.promise();

var displaySiteStatus = function () {
    getSiteProperties().then(function (props, isSiteAdmin, isOwner) { displayMessage(props, isSiteAdmin, isOwner); });

This has been tested on another environment and found working. Now deploying it to the client environment, the objects returned by the object model are instantiated, but not filled with data. No matter what property I try to read, everything gives the same error message;

The property or field 'IsSiteAdmin' has not been initialized. It has not been requested or the request has not been executed. It may need to be explicitly requested.

It seems to be a platform related thing since the same code works fine elsewhere. But I have no clue and I don't have access to the platform to peek in the logs or something.

  • It should work, but could you try: ctx.load(user, 'IsSiteAdmin'); Commented Jan 20, 2016 at 13:17
  • Jup tried that, makes no difference. I also tried another site collection, weirdly it works like a charm on that one.
    – Jasper
    Commented Jan 21, 2016 at 10:17
  • Have you tried fetching the property with REST ? Commented Jan 22, 2016 at 7:37

1 Answer 1


I'm not sure where you are referencing title since it isn't in your method.

If I execute the following code both objects contain the data I would expect when the done method executes.


Are you sure you are working with the deferred object correctly? You can read more here.

  • Sorry the error was taken from a different piece of code, as said it doesn't matter which property I try to read. The same code runs fine on a different environment so I would say we can pretty much rule out any real coding errors.
    – Jasper
    Commented Jan 18, 2016 at 17:43
  • Can you give an example of how you are using this code?
    – Gilgamesh
    Commented Jan 18, 2016 at 18:35
  • I cannot share the whole file, it's client source code. What exactly would you want to see? I don't completely see how this is relevant since the code is functioning, the platform isn't.
    – Jasper
    Commented Jan 18, 2016 at 21:16
  • Given that you posted this code as what you suspect is the cause of the issue, I'm curious as to how you are using the this method and the promise it returns as well as what properties you are trying to reference once the promise is resolved.
    – Gilgamesh
    Commented Jan 19, 2016 at 13:10
  • Ok, so I added the calling code and what happens with the promise. Routine itself changed a bit too, just to make it more clear. Note that the resolve of the promise is not hit because the error already happens on calling user.get_isSiteAdmin().
    – Jasper
    Commented Jan 19, 2016 at 13:57

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.