ILayerDescription.DefinitionExpression doesn't return expression set in mxd - ArcObject SDK 10.2.1

02-18-2015 12:12 AM
New Contributor III

Hi all,

After we upgraded our Server Object Extension from 10.0 to 10.2.1,

it is found that DefinitionExpression property doesn’t return the expression we set in the source mxd file.

The code is below:

IMapServerInfo mapServerInfo = mapServer.GetServerInfo(mapName);

IMapDescription mapDescription = mapServerInfo.DefaultMapDescription;

ILayerDescriptions layerDescriptions = mapDescription.LayerDescriptions;

ILayerDescription layerDescription = layerDescriptions.get_Element(i);

// get DefinitionExpression

string definitionExpression = layerDescription.DefinitionExpression; //retune nothing?

With ArcObjectSDK 10.0, the above line returns the expression specified in the mxd file for a layer,

But with ArcObjectSDK 10.2.1, the property returns nothing.

Has anyone seen the behaviour? Is this a bug in ArcObjectSDK 10.2.1 ILayerDescription.DefinitionExpression?

Thanks in advance.

Youmei Ge

0 Kudos
1 Reply
Occasional Contributor II

Hi Youmei,

Apparently there was a bug related to the DefinitionExpression method returning nothing: NIM094075

Supposedly it's fixed at 10.2.1 ... but maybe it's not.  You may want to contact Esri Support to verify.

0 Kudos