AnsweredAssumed Answered

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

Question asked by youmei_ge on Feb 18, 2015
Latest reply on Feb 18, 2015 by ebrimhall

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

Outcomes