eSearch widget and related tables

I am using the eSearch widget in web appbuilder 1.2 and am running into an issue when trying to search on a layer that has tables related to it. My relates are set up in an MXD which I created a map service from. Pop-ups work fine in Portal, as well as in WAB. However, when I add the layer to eSearch (Parcels) and try to search on it using eSearch, I get this error:

It works fine when I remove the layer with related tables. Has anyone seen this? Is it a bug or limitation to the eSearch widget or am I not doing something I'm supposed to be doing? I'd appreciate any input anyone has on this.

We did some troubleshooting and found that there is one line in the _getLayerInfoWithRelationships function in the Widget.js file that we changed and resolved our issue with related tables. There are 4 resolve statements toward the end of the function as shown below:

def.resolve({state: 'success', value: layerInfo});

}), lang.hitch(this, function (err) {

def.resolve({state: 'failure', value: err});

}));

def.resolve(layerInfo);

}), lang.hitch(this, function (err) {

def.resolve({state: 'failure', value: err});

}));

return def;

},

If we change the one underlined above to match the same pattern as the others as shown below, the related tables seem to work in esearch.

def.resolve({state: 'success', value: layerInfo});

It looks like the state attribute was missing from that one statement.

Most of the time you see that message when the widget fails to get the layerinfo from your map service for some reason.

You mention the data has relates having related tables on a layer is not an issue. I have multiple layers that are used in the eSearch that have related tables. Now searching a related table is not supported in the eSearch widget. Currently searching layer with no spatial component (i.e. tables) is not supported by the eSearch widget.

We did some troubleshooting and found that there is one line in the _getLayerInfoWithRelationships function in the Widget.js file that we changed and resolved our issue with related tables. There are 4 resolve statements toward the end of the function as shown below:

def.resolve({state: 'success', value: layerInfo});

}), lang.hitch(this, function (err) {

def.resolve({state: 'failure', value: err});

}));

def.resolve(layerInfo);

}), lang.hitch(this, function (err) {

def.resolve({state: 'failure', value: err});

}));

return def;

},

If we change the one underlined above to match the same pattern as the others as shown below, the related tables seem to work in esearch.

def.resolve({state: 'success', value: layerInfo});

It looks like the state attribute was missing from that one statement.

I have a general question about the eSearch widget. When I perform a search on a feature class (parcels) that has tables related to it (owners), should the owner table information show up in the attribute table like the parcel layer attributes do?

There is a line item in the "Older enhancements or changes.txt" file, under "Version 1.1x list:" that states "*Search results now support related records link from the popup and the Attribute Table Widget will now open related records properly". That lead me to believe the related table attributes should open in the Attribute Table after performing a search using the eSearch. However, I cannot get that functionality to work and have tried just about everything in my testing.

So my question is; am I reading that wrong? Does eSearch support this functionality? If not, then I will stop testing and trying to figure out how to configure that.

Thanks for all the work you have done developing these custom widgets. They have been very useful!

That note from 1.1x is saying that if the popup for the layer has a related records link inside of the popup then this will open the related table in the Attribute table widget. But that was a long time ago and the way search results are handled now after a couple of WAB versions this is not an option any more.