Quantcast
Channel: CRM Development 論壇
Viewing all articles
Browse latest Browse all 10280

How to get the Optionset field text from OData result in ms crm 2011

$
0
0

Hi,

I am retrieving the Opportunity record data from Quote entity. I am getting the Opportunity record optionset value in OData result set. But I need Optionset Text. How to get this optionset text from this OData result set. Below is my code.

function GetOpportunityData()
{
  //debugger;
  var opplookup = Xrm.Page.getAttribute("opportunityid").getValue();
  if(opplookup[0] != null)
  {
     var opplookupguid = opplookup[0].id;
     var serverUrl =document.location.protocol + "//" + document.location.host + "/" + Xrm.Page.context.getOrgUniqueName();
     var odataSelect = serverUrl + "/XRMServices/2011/OrganizationData.svc/OpportunitySet(guid'" + opplookupguid + "')";    
  
    $.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)
 {
  RetrieveEntityData(data.d);
   },
 error: function (XmlHttpRequest, textStatus, errorThrown) { alert('OData Select Failed: ' + odataSelect); }
 });  

  }
}

function RetrieveEntityData(Entity)
{
 // get the fields from the Entity object
 var optValu = (eval(Entity.StatusCode.Value));// Here getting the Optionset value

}

Please provide the sample code how to get the text from this result in OData.

Thanks,


Yadav


Viewing all articles
Browse latest Browse all 10280

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>