正在从其他来源获取领土名称和 ID,我想使用该领土名称或 ID 在我的 javascript 中检索该领土的成员,如何获得它,
var serverUrl = Xrm.Page.context.getServerUrl();
//The XRM OData end-point
var ODATA_ENDPOINT = "/XRMServices/2011/OrganizationData.svc";
var odataSetName = "TerritorySet";
var odataSelect = serverUrl + ODATA_ENDPOINT + "/" + odataSetName + "(guid'" + territoryId+ "')";
//alert(odataSelect);
$.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)
{
var result_contact= data.d;
var des = result_contact.Description;
alert(des);
}
},
error: function (XmlHttpRequest, textStatus, errorThrown)
{
// alert('OData Select Failed: ' + odataSelect);
}
});
任何帮助将不胜感激.. 提前致谢,