web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

error. [object Object]

(0) ShareShare
ReportReport
Posted on by 60

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 + "&#8226 " + 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);
}
}

I have the same question (0)
  • Mahendar Pal Profile Picture
    45,095 on at

    What is the IE version, have you tried with other browsers like chrome ? you debug your code and see error details in developer tools

  • Suggested answer
    sdfasdf Profile Picture
    842 on at

    You're getting that alert message because of this piece of code:

               error: function (result) {

                   alert("GetReliefIndicator - error. " + result);

               }

    In order to further understand what's going on, you might want to collect Fiddler traces and determine what error your server is returning to your code. Additionally, if you change the above piece of code as follows, it might give you a hint on what the problem is:

               error: function (result) {

                   alert("GetReliefIndicator - error. " + result.message);

               }

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 72 Super User 2025 Season 2

#2
Daniyal Khaleel Profile Picture

Daniyal Khaleel 32 Most Valuable Professional

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 29 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans