Problems with Relates and the Enhanced Search Widget

1258
18
Jump to solution
09-11-2012 06:24 PM
GeorgeHaskett
Occasional Contributor III
Hello,

I am trying to figure out how to get my relates functions to work with the Enhanced Search Widget.

I have created a relationship between a layer and a table within ArcMap in my mxd document and created a shared service, however I cannot seem to figure out how to get the relate to populate in the grid and get the relate popup window to open.

Can someone explain the basics, seeing how I am somehow missing something?

Does the relate need to happen within the geodatabase instead of the mxd document?

Thanks,

George
Tags (2)
0 Kudos
18 Replies
RobertScheitlin__GISP
MVP Emeritus
Aaron,

   So I have made a few minor changes but nothing that would prevent the relate from working that I know of.

        <layer>
            <definitionexpression></definitionexpression>
            <enableexport>true</enableexport>
            <name>Sites</name>
            <url>https://XXXXXXX/ArcGIS/rest/services/Test/Test_Map/MapServer/2</url>
            <expressions>
                <expression alias="Name">
                    <values>
                        <value userlist="1,2,3,4">upper(Name) = upper('[value]')</value>
                    </values>
                </expression>
                <expression alias="Parcel ID Number" textsearchlabel="Search Parcel ID#:">
                    <values>
                        <value prompt="Example: 2102924430038 or 2102%"> PID_NO like '[value]'</value>
                    </values>
                </expression>
                <expression alias="Address" textsearchlabel="Building Number and Street Name:">
                    <values>
                        <value prompt="Example: 801">BLDG_NUM = '[value]'</value>
                        <value prompt="Example: 2ND AVE N">AND upper(STREETNAME) = upper('[value]')</value>
                    </values>
                </expression>
            </expressions>
            <graphicalsearchlabel>Use one of the graphical search tools to select Site</graphicalsearchlabel>
            <spatialsearchlayer>true</spatialsearchlayer>
            <titlefield>Name</titlefield>
            <fields all="false">
                <field name="Name" alias="Site Name" gridfield="true" />
                <field name="BLDG_NUM" alias="Building Number" gridfield="true" />
                <field name="STREETNAME" alias="Street" gridfield="true" />
                <field name="City" alias="City" gridfield="true" />
                <field name="PID_NO" alias="Parcel ID#" gridfield="true" />
            </fields>
            <links />
            <zoomscale usegeometry="true" zoompercent="1.6" />
            <autoopendatagrid>false</autoopendatagrid>
            <relates>
                <relate id="0" label="Documents" enableexport="true" icon="assets/images/i_folder.png">
                    <fields all="true" />
                </relate>
            </relates>
            <queryattachments>false</queryattachments>
        </layer>


My big concern is the URL
<url>https://XXXXXXX/ArcGIS/rest/services/Test/Test_Map/MapServer/2</url>

I have never tested with a https secured url and have no ability to do so, so I don't know if this widget supports https urls.
0 Kudos
AaronMielke
New Contributor III
Robert,
Thanks for your repsonse. All of the other functionality works with https. Just the relate isns't working. A few questions.

1) Have you tested eSearch with data in SDE?
2) Can the relate be a stand alone table or does it have to be a spatial data set?
3) Does it matter if the relate is set up in the data base or in the map?

Thanks,
Aaron
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Aaron,

1) Have you tested eSearch with data in SDE? Yes almost all my data is in SDE
2) Can the relate be a stand alone table or does it have to be a spatial data set? Yes it can be standalone or spatial
3) Does it matter if the relate is set up in the data base or in the map? I have tested both ways and both work
0 Kudos
AaronMielke
New Contributor III
Robert,
It looks like the problem is the secured service. When I click on the "Show Relates" icon it puts a request to the REST Services directory but it is not authorized to view the data. Somehow the token has to be embedded in the request. Currently the request is https://maps.barr.com/ArcGIS/rest/services/Demos/Test_Relate/MapServer/1?f=json

Thanks,
Aaron
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Aaron,

   So how is the token being provided to me in this situation? Is it part of the search layers url or did you already have to login using the identity manager?
0 Kudos
RichDeBell
New Contributor II
Hi I need to piggy back on this issue. I have the same problem with a secured url. Has any resolution been found for this?

thanks

Rich
0 Kudos
NinaRihn
Occasional Contributor III
Aaron,

   So how is the token being provided to me in this situation? Is it part of the search layers url or did you already have to login using the identity manager?


I am having this problem too.. currently, my token is being passed just once, under the Layer URL:
<url>https://xxxxx.us/SQL/rest/services/WIARNG_Facilities/Fac_Basemap_WMAS_Cache/MapServer/0/?token=qNzOq...</url>

I am able to search the layer, but then when I click the icon in the Get Related dialog, nothing happens even though I know there are related records for that layer record.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Nina,

   Thanks for the info. Yours is a situation that I can get fixed in the next release of the widget. In the latest release of the eSearch Widget I introduced a token element for each layer. If you put your token in there then I can use that in the next release to pass along to the relate query.

Edit: One of the other issues I see in your url you have a / after the layer id and that will cause an issue in my code. Make sure you do not use the / after the layer id:

<url>https://xxxxx.us/SQL/rest/services/WIARNG_Facilities/Fac_Basemap_WMAS_Cache/MapServer/0/?token=qNzOqxLPck6visgtQ9wY-NLoaT35el4VYrb7KKcCpbe1vsVTZs3WcvzI79B5w_hE</url>
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
All,

   Another update is released:

Version 3.1.3 - 1/11/2013
* Fixed some issues with relates and uniquevalsfromfield when using tokens.
* Fixed some issues if the layers url contains the token.
0 Kudos