Select to view content in your preferred language

ArcGISDynamicMapServiceLayer LayerDefinitions 10.0 to 10.2

791
2
Jump to solution
03-20-2014 11:09 AM
JamieSimko
Regular Contributor
We are currently upgrading from a 10.0 to a 10.2 server and are having issues with one of our apps built in JavaScript. The JavaScript API is generating an export map call with layer definitions setup like:

6:(USERNAME = 'test');7:(USERNAME = 'test')


Which works fine in 10.0 but fails in 10.2. I looked at examples in the documents and found one here which shows that the request should be sent with the parameter like:

{6:(USERNAME = 'test'),7:(USERNAME = 'test')}


Note that it is wrapped in curly braces and layers are separated by commas instead of semi-colons.

To setup these definitions in the code all I did was (not the exact code):

var definitions = []; definitions[6] = '(USERNAME = 'test')'; definitions[7] = '(USERNAME = 'test')';  service.setLayerDefinitions(definitions);


Anybody have any thoughts on what I might be doing wrong or if this could be a bug in the api?

NOTE: 10.0 api works with commas instead of semi-colons but fails when wrapped with curly braces. 10.2 only works with semi-colons and must be wrapped with curly braces

Thanks,
- Jamie
0 Kudos
1 Solution

Accepted Solutions
JamieSimko
Regular Contributor
My original question here had the actual bug omitted from it.

The root cause of my error was that I used "!=" instead of "<>" for not equals in my layerDefs.

Here are my test cases for those interested; there are a couple differences between 10.0 and 10.2
Note:
- I removed the samples from each test but kept pass/fail & the key parts that differentiated.
- TEST 1 & 2 are in the format sent by the REST API
- I was using test 2 in my code which caused the issue for me (needed to switch to test 1 format)
- I don't think I've included all cases, there are probably at least 2 tests I missed here that weren't relevant.

**************************                 10.0 TESTING ************************** TEST 1 - PASS (JavaScript API will send like this (using <> as operator))  TEST 2 - PASS (JavaScript API will send like this (using != as operator))  TEST 3 - FAIL ( wrapped in curly braces, separated by semi-colons, and not equals operator: "<>" )  TEST 4 - FAIL ( wrapped in curly braces, separated by semi-colons, and not equals operator: "!=" )  TEST 5 - FAIL ( wrapped in curly braces, separated by semi-colons, and not equals operator: "!=" )  TEST 6 - FAIL ( wrapped in curly braces, separated by commas, and not equals operator: "!=" )  **************************                 10.2 TESTING ************************** TEST 1 - PASS (JavaScript API will send like this (using <> as operator))  TEST 2 - FAIL (JavaScript API will send like this (using != as operator))  TEST 3 - FAIL ( wrapped in curly braces, separated by semi-colons, and not equals operator: "<>" )  TEST 4 - FAIL ( wrapped in curly braces, separated by semi-colons, and not equals operator: "!=" )  TEST 5 - FAIL ( wrapped in curly braces, separated by semi-colons, and not equals operator: "!=" )  TEST 6 - PASS ( wrapped in curly braces, separated by commas, and not equals operator: "!=" )

View solution in original post

0 Kudos
2 Replies
JamieSimko
Regular Contributor
My original question here had the actual bug omitted from it.

The root cause of my error was that I used "!=" instead of "<>" for not equals in my layerDefs.

Here are my test cases for those interested; there are a couple differences between 10.0 and 10.2
Note:
- I removed the samples from each test but kept pass/fail & the key parts that differentiated.
- TEST 1 & 2 are in the format sent by the REST API
- I was using test 2 in my code which caused the issue for me (needed to switch to test 1 format)
- I don't think I've included all cases, there are probably at least 2 tests I missed here that weren't relevant.

**************************                 10.0 TESTING ************************** TEST 1 - PASS (JavaScript API will send like this (using <> as operator))  TEST 2 - PASS (JavaScript API will send like this (using != as operator))  TEST 3 - FAIL ( wrapped in curly braces, separated by semi-colons, and not equals operator: "<>" )  TEST 4 - FAIL ( wrapped in curly braces, separated by semi-colons, and not equals operator: "!=" )  TEST 5 - FAIL ( wrapped in curly braces, separated by semi-colons, and not equals operator: "!=" )  TEST 6 - FAIL ( wrapped in curly braces, separated by commas, and not equals operator: "!=" )  **************************                 10.2 TESTING ************************** TEST 1 - PASS (JavaScript API will send like this (using <> as operator))  TEST 2 - FAIL (JavaScript API will send like this (using != as operator))  TEST 3 - FAIL ( wrapped in curly braces, separated by semi-colons, and not equals operator: "<>" )  TEST 4 - FAIL ( wrapped in curly braces, separated by semi-colons, and not equals operator: "!=" )  TEST 5 - FAIL ( wrapped in curly braces, separated by semi-colons, and not equals operator: "!=" )  TEST 6 - PASS ( wrapped in curly braces, separated by commas, and not equals operator: "!=" )
0 Kudos
JeffPace
MVP Alum
I think you ran into ESRI's new "standardized" SQL

you can turn this off

http://support.esri.com/en/knowledgebase/techarticles/detail/41561
0 Kudos