Hi,
The JS code runs well in Windows XP/7 using Internet Explorer (in this case ver 11)
But it will prompt 'GetReliefIndicator - error. [object Object]' when I run it in Windows 10 using Internet Explorer (same ver).
Anyone can give me a hint how to solve this?
function GetReliefIndicator(accountPoid) {
try {
if (Xrm.Page.getAttribute("p1_reliefid").getValue() != null) {
if (Xrm.Page.getAttribute("p1_reliefid").getValue().length > 0) {
return;
}
}
var Instance = Xrm.Page.context.getClientUrl();
Instance = Instance.substring(0, Instance.lastIndexOf(":"));
$.support.cors = true;
$.ajax({
type: "POST",
url: Instance + "/CustomerService/BCCSservice.svc/GetReliefIndicator",
data: '{"strAccountId": "' + accountPoid + '"}',
contentType: "application/json; charset=utf-8",
headers: { 'Access-Control-Allow-Origin': '*' },
crossDomain: true,
dataType: 'json',
processdata: true,
success: function (result) {
var data = JSON.parse(result.GetReliefIndicatorResult);
if (data != null) {
if (data.ErrorDescription != null && data.ErrorDescription.length > 0) {
alert(data.ErrorDescription);
} else if (data.ID != null && data.ID.length > 0) {
Xrm.Page.getAttribute("p1_reliefid").setValue(data.ID);
var dtExpiry = new Date(parseInt(data.Expiry));
Xrm.Page.getAttribute("p1_reliefexpiry").setValue(dtExpiry);
Xrm.Page.getAttribute("p1_relieftype").setValue(data.Type);
if (data.Type != null && data.Type.length > 0) {
var types = data.TypeName.split("|");
var typeListBox = "";
var width = $('#p1_reliefid_container')[0].clientWidth;
$(types).each(function (i, o) { typeListBox = typeListBox + "• " + o + "<br />"; });
typeListBox = "<div style=\"position:absolute;background-color:#BDBDBD;height:100px;overflow:scroll;width:" + width + "px\">" + typeListBox + "</div>";
$('#p1_relieftype_d').append(typeListBox);
$('#p1_relieftype_container').hide();
}
}
}
},
error: function (result) {
alert("GetReliefIndicator - error. " + result);
}
});
} catch (e) {
alert(e);
}
}