receiving an output error from a geoprocessing widget in portal for arcgis

1135
2
06-29-2017 06:12 PM
SvivaManager
Occasional Contributor II

Hello,

i have an application with a geoprocessing tool widget which I tried to show an output message for the users once its finished. but every time it's done, the output text is Error.

I've spent a few good hours, trying dozens of things to try and understand what the problem is.

So eventually I got it sorted. I managed to find the solution and after so much frustration and attempts, I thought this might help someone in the future.

I was extremely surprised to see no one have noticed this before tho. I found a few similar posts but not with the same issue.

So I finally discovered that the output message text works perfectly on Chrome but not on Internet Explorer - the python script was fine! it was the application that didn't showed an output message.

At first I left it aside, but since everyone in our office uses Internet Explorer, It was embarrassing to tell them to change their habbits just for that issue, so it was either open a bug in ESRI and wait who knows how many months or try and solve it on my own.

In the Geoprocessing widget folder there is a file called resultRendererManager.JS

There are a few calls in the file to a function called "includes" - this function is unsupported by Internet Explorer and Opera.

I replaced them all with indexOf(s) >= 0 and now it all works perfectly fine.

This is pretty much a bug of ESRI I believe. It cost me hours of investigation and frustrations I must say. Hopefully this post will help someone in the future.

Regards,

Shay.

2 Replies
JoelEdgar
New Contributor II

Hi Shay,

Thanks for this post. I am also having this same issue. Could you please attached a screenshot of the code changes you made to resultRendererManager.JS. I am having trouble implementing the changes you said to make. Thanks.

0 Kudos
SvivaManager
Occasional Contributor II

Hi Joel,

Here are lines 50-70 of the code:

      array.forEach(values, function (val) {
        if (text !== "") {
          text += '<br>';
        }
        if (['GPLong', 'GPDouble', 'GPString', 'GPBoolean']
          .some(function (s) { return /*param.dataType.includes(s);*/ (param.dataType.indexOf(s) >= 0) })) {
          text += utils.sanitizeHTML(val);
        } else if (/*param.dataType.includes('GPLinearUnit')*/(param.dataType.indexOf('GPLinearUnit') >= 0)) {
          text += val.distance + ' ' + val.units;
        } else if (/*param.dataType.includes('GPDate')*/(param.dataType.indexOf('GPDate') >= 0)) {
          text += new Date(val).toLocaleTimeString();
        } else if (/*param.dataType.includes('GPRecordSet')*/(param.dataType.indexOf('GPRecordSet') >= 0)) {
          text += 'table';
        } else if (/*param.dataType.includes('GPDataFile')*/(param.dataType.indexOf('GPDataFile') >= 0) || /*param.dataType.includes('GPRasterDataLayer')*/(param.dataType.indexOf('GPRasterDataLayer') >= 0)) {
          if (val.url) {
            text += '<a target="_blank" href="' + val.url + '">' + val.url + '</a>';
          } else {
            text += param.paramName + ': null';
          }
        }
      });

Hope it helps.

Regards,

Shay.