Select to view content in your preferred language

eSearch error when searching multiple fields

1969
15
Jump to solution
08-27-2012 01:10 PM
JustinFultz
Regular Contributor
I am trying to search using multiple fields on the Enhanced search widget, version 2.9.0. I am at flex version 2.5 and recently upgraded my search widget to 2.9 specifically for this functionality. Everything is working as it should except when I add a second value in a search I get the follwoing error: RPC Fault faultStign-"Unable to complete operation." faultCode="400" faultDetail="Unable to complete Query operation."

I am able to do each search seperately, so I don't know what the issue is.

Here is my code:

<layer>    <definitionexpression></definitionexpression>    <enableexport>false</enableexport>    <name>Generation</name>               <url>http://dcpgisav/ArcGIS/rest/services/Operations/Generation/MapServer/0</url>             <expressions>              <expression alias="EMS Name" textsearchlabel="Search EMS Name:">               <values>                 <value prompt="Example: ARSENAL">upper(EMS_STATION_NAME) like upper('%[value]%')</value>                </values>              </expression>              <expression alias="Balancing Authority" textserachlabel="Select Balancing Authority...">               <values>                <value prompt="Select an area:" field="CTRLAREA" usedomain="true">CTRLAREA = '[value]'</value>                <value prompt="Select a fuel type:" field="PRIMARY_FUEL" usedomain="true">PRIMARY_FUEL = '[value]'</value>               </values>              </expression>             </expressions>


Any help is appreciated!!!
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus
Justin,

   You have to have an AND or OR before your second SQL expression.

                    <values>                         <value prompt="Select an area:" field="CTRLAREA" usedomain="true">CTRLAREA = '[value]'</value>                         <value prompt="Select a fuel type:" field="PRIMARY_FUEL" usedomain="true"> AND PRIMARY_FUEL = '[value]'</value>                     </values>

View solution in original post

0 Kudos
15 Replies
RobertScheitlin__GISP
MVP Emeritus
Justin,

   You have to have an AND or OR before your second SQL expression.

                    <values>                         <value prompt="Select an area:" field="CTRLAREA" usedomain="true">CTRLAREA = '[value]'</value>                         <value prompt="Select a fuel type:" field="PRIMARY_FUEL" usedomain="true"> AND PRIMARY_FUEL = '[value]'</value>                     </values>
0 Kudos
JustinFultz
Regular Contributor
Thanks Robert! That did the trick.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Justin,

Don't forget to click the Mark as answer check on this post and to click the top arrow (promote).
Follow the steps as shown in the below graphic:
0 Kudos
JacobBoyle
Deactivated User
I'm having the same error, here's a copy of my code.  I'm not sure what exactly is causing the issue.

<layer>
   <definitionexpression></definitionexpression>
   <enableexport>true</enableexport>
   <name>SRC Land Data</name>
   <url>http://pit-arcgis/arcgis/rest/services/Land/PA_Land_Data/MapServer/10</url>
   <expressions>
    <expression alias="Agreement Number" textsearchlabel="Search Agreement Number:">
     <values>
      <value prompt="Example: 061853" >upper(AGMT_NUM) like upper('%[value]%')</value>
     </values>
    </expression>
    <expression alias="Lessor" textsearchlabel="Search Lessor:">
     <values>
      <value prompt="Example: Bob Smith">upper(LESSOR) = upper('[value]')</value>
     </values>
    </expression>
   </expressions>
   <graphicalsearchlabel>Use one of the graphical search tools to select Land Data</graphicalsearchlabel>
   <spatialsearchlayer>true</spatialsearchlayer>
   <titlefield>AGMT_NUM</titlefield>
   <fields all="false">
    <field name="AGMT_NUM" alias="Agreement Number" gridfield="true"/>
    <field name="LESSOR" alias="Lessor" gridfield="true" />
    <field name="LEASE_DATE" gridfield="true" alias="Lease Date" dateformat="MM/DD/YYYY" />
    <field name="LEASE_YEAR" gridfield="true" alias="Lease Year" />
    <field name="EXPR_DATE" alias="Expiration Date" gridfield="true" dateformat="MM/DD/YYYY" />
    <field name="CALC_ACRES" alias="Calculated Acreage" gridfield="true" />
    <field name="NET_ACRES" alias="Net Acreage" gridfield="true" />
    <field name="GROSS_ACRES" alias="Gross Acreage" gridfield="true" />
    <field name="RIGHTSSHORT" alias="Rights Short" gridfield="true" />
    <field name="LEASETYPE" alias="Lease Type" gridfield="true" />
    <field name="RIGHTSHELD" alias="Rights Held" gridfield="true" />
    <field name="LEASESTATUS" alias="Lease Status" gridfield="true" />
   </fields>
   <links/>
   <zoomscale usegeometry="true" zoompercent="2"></zoomscale>
  </layer>

any light you can shed on my issue, I'd appriciate.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Jacob,

   Is your AGMT_NUM field numeric or text?
0 Kudos
JacobBoyle
Deactivated User
It is a text field.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Jacob,

   Do both expressions give you the error?
0 Kudos
JacobBoyle
Deactivated User
Yes, the spatial search doesn't work either.

We upgraded the server this weekend (10.0--> 10.1), I made sure all the services are pointing to the right sources.  Other layers I search work from the same server.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Jacob,

   You might want to also check if the service can be queried from the rest service directory using similar SQL expression. There has been reports of map services not functioning properly once server has been upgraded so I would republish the service.
0 Kudos