callData: function()
{
var urlWAF = myWidget.spaceURL + "/resources/WMSREQRestServiceModeler/getWorkOrderDetails";
var dataWAF={
"state": "Active",
};
/*var headerWAF={
"SecurityContext": "ctx::VPLMAdministrator.Company Name.Default"
};*/
var methodWAF = "GET";
WAFData.authenticatedRequest(urlWAF, {
method: methodWAF,
//proxy:'passport',
data: dataWAF,
type: 'json',
onComplete: function (dataResp) {
if(dataResp.msg==="OK"){
//myWidget.dataFull=JSON.parse(dataResp.data);
myWidget.dataFull=dataResp.data;
myWidget.displayData(myWidget.dataFull);
console.log(myWidget.dataFull);
}else{
widget.body.innerHTML += "<p>Error in WebService Response</p>";
widget.body.innerHTML += "<p>"+JSON.stringify(dataResp)+"</p>";
}
},
onFailure: function(error){
widget.body.innerHTML += "<p>Call Failure</p>";
widget.body.innerHTML += "<p>"+JSON.stringify(error)+"</p>";
}
});
},
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (6)
You've just posted a code sample, without any explanation of:
1) What have you already tried?
2) The issue is obviously with the code trying to parse
dataResp.data
, but you haven't provided a snippet of that.You would find people are far more willing to help if you put a little bit of effort into your question.
Actually I was trying to get the response data in the custom widgets . but I am facing the error
I am getting the call failure.
Have you tried just logging out the response?
its not working .
const data = ["{woTitle=Accetylene-WO-1, owner=GE Works, woId=34288.53217.59361.13307, objid=34288.53217.59675.21431, name=OXYACE-MB-wo1-000002, taskName=IT0000137, taskAssignmentDate=4\/21\/2020 1:25:09 PM, title=my mb, sorids=[14, 13], taskId=34288.53217.10065.19472, objectType=Measurements, measurementdate=29-Feb-2020}"]
Can you parse this string in json object ??
That's not valid JSON. Stick it in an online parser and it will probably give you the reasons why.