English 中文(简体)
JSON “未定义”在研究2011年消费物价指数时
原标题:JSON "undefined" when looking up CRM 2011 systemuserid

该法典(在JSON的下线)对以下JSON数据和“未定义的”回报进行了评估,尽管显然可以提供系统使用。 事先得到帮助。

    {
    "d" : {
    "results": [
    {
    "__metadata": {
    "uri": "http://dynamics/DynamicsCRM/xrmservices/2011/OrganizationData.svc/new_new_license_sys        temuserSet(guid 561d5751-0496-e111-84f8-0050561a2a63 )", "type": "Microsoft.Crm.Sdk.Data.Services.new_new_license_systemuser"
    }, "new_new_license_systemuserId": "561d5751-0496-e111-84f8-0050561a2a63", "new_licenseid": "538e6567-8c95-e111-84f8-0050561a2a63", "systemuserid": "40dda08e-2ee5-e011-b843-0050561a2a63", "VersionNumber": null
    }
    ]
    }
    }

    $.ajax(
    {        type: "GET",
            contentType: "application/json; charset=utf-8",
            datatype: "json",
            url: odataSelect,
            beforeSend: function (XMLHttpRequest) 
                { XMLHttpRequest.setRequestHeader("Accept", "application/json"); },
            success: function (data, textStatus, XmlHttpRequest)
                    {            
                   ProcessReturnedEntity(data.d);
                    },
           error: function (XmlHttpRequest, textStatus, errorThrown)
                    { alert( OData Select Failed:   + odataSelect); 
                    }
    });

    ProcessReturnedEntity = function(OneEntity)
    {
    var one = OneEntity;
    var Userid = one.systemuserid;
    alert(Userid);
    }
问题回答

Have you used the internet explorer F12 Developer Tools to step into that line and inspect the variables involved? You mention "even though it is clear that systemuserid is available", if it is undefined, it is not available on that object, or perhaps that object itself is null for whatever reason. Hope that helps.

可查阅<代码>json。 公布的结果认为,你应设法查阅<编码> 系统使用<>/代码>。 类似:

 var Userid = one.results[0].systemuserid;




相关问题
JQuery/MVC Search Issue

I have inherited a piece of work where the entry screen shows a summary of 20 calculated variables. E.g. Var A (250), Var B (79). Clicking on any of these links takes the user to a view with a ...

jQuery quicksearch plug-in tinkering with JSON

I ve implemented the quicksearch plugin by Rik Lomas and I love it for an application in a custom CMS I m building. I was wondering though, since I m going to have a bizillion items in the table if ...

JSON with classes?

Is there a standardized way to store classes in JSON, and then converting them back into classes again from a string? For example, I might have an array of objects of type Questions. I d like to ...

PHP json_decode question

i m trying to use json_decode to combine a few json objects and then re-encode it. my json looks like: { "core": { "segment": [ { "id": 7, "...

Converting JSON data to Java object

I want to be able to access properties from a JSON string within my Java action method. The string is available by simply saying myJsonString = object.getJson(). Below is an example of what the string ...

热门标签