Kristian Ekenes,
Yes. I am referencing the same field in the Query Task that I tried to reference in the Identify Task.
The syntax is a little different though.
In the Identify Task...
value= results[0].feature.attributes.FieldName;
In the Query Task...
value= results.features[0].attributes.FieldName;
I don't know if it makes a difference or not... but I am still referencing the JS API version 3.6. I hope the functionality hasn't changed in the latest release. (which is currently at 3.14).
Another thing I am going to note:
There are several places in the map document where I have selected to NOT display the coded value description.
I have not done enough testing to know if any of these settings make a difference or not.
In the Layer Properties:
Display > Expression > Uncheck "Display coded value description"
Labels > Expression > Uncheck "Display coded value description"
HTML Popup > Uncheck "Display coded value descriptions in all HTML content"
In the Attribute Table:
Table Options > Appearance > Uncheck "Display coded value domain and subtype descriptions"
In ArcMap Options:
Customize > ArcMap Options > Uncheck "Display coded value domain and subtype descriptions"