locked
CRM 2011 - oDATA returns undefined after JSON RRS feed

  • Question

  • I am having an issue with retrieving data with CRM 2011 and UR 13 using oData. Below you will see the code we are attempting to use along with the results the sdk.rest is returning. All of this is what we are expecting, except when it goes into JSON to be parsed, it comes out as undefined. So the successCallback alerts undefined. Does anyone have any ideas regarding this? Am I trying to alert the wrong thing? Thank you for your assistance.

    //The oppid has been set to the guid of the opportunity.

    //Uses sdk.rest and JSON from CRM SDK

    SDK.REST.retrieveRecord(

         oppid,

         "Opportunity",

         "EstimatedValue", null,

         function(opp)

            {alert(opp.EstimatedValue);},

         function()

            {alert("Error");});

    Thursday, July 25, 2013 1:28 PM

All replies

  • Hi

    Try

      {alert(opp.EstimatedValue.Value);},

    instead of

       {alert(opp.EstimatedValue);},


    If this post answers your question, please click "Mark As Answer" on the post and "Vote as Helpful" Thank you, DT

    Friday, July 26, 2013 5:52 AM
  • Hi

    Try

      {alert(opp.EstimatedValue.Value);},

    instead of

       {alert(opp.EstimatedValue);},


    If this post answers your question, please click "Mark As Answer" on the post and "Vote as Helpful" Thank you, DT

    Alerts undefined:

    Friday, July 26, 2013 12:11 PM