<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic ILayerDescription.DefinitionExpression doesn't return expression set in mxd - ArcObject SDK 10.2.1 in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/ilayerdescription-definitionexpression-doesn-t/m-p/733122#M19494</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;Hi all,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;After we upgraded our Server Object Extension from 10.0 to 10.2.1, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;it is found that &lt;SPAN style="mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi;"&gt;DefinitionExpression property doesn’t return the expression we set in the source mxd file. &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="mso-bidi-font-family: 'Times New Roman'; font-size: 10pt; mso-hansi-theme-font: minor-latin; font-family: arial,helvetica,sans-serif; mso-ascii-theme-font: minor-latin; mso-bidi-theme-font: minor-bidi;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="mso-bidi-font-family: 'Times New Roman'; font-size: 10pt; mso-hansi-theme-font: minor-latin; font-family: arial,helvetica,sans-serif; mso-ascii-theme-font: minor-latin; mso-bidi-theme-font: minor-bidi;"&gt;The code is below:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="mso-bidi-font-family: 'Times New Roman'; mso-hansi-theme-font: minor-latin; mso-ascii-theme-font: minor-latin; font-family: 'Calibri','sans-serif'; mso-bidi-theme-font: minor-bidi;"&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #2b91af; font-size: 10pt; font-family: Consolas;"&gt;IMapServerInfo&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Consolas;"&gt; mapServerInfo = mapServer.GetServerInfo(mapName);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #2b91af; font-size: 10pt; font-family: Consolas;"&gt;IMapDescription&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Consolas;"&gt; mapDescription = mapServerInfo.DefaultMapDescription;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #2b91af; font-size: 10pt; font-family: Consolas;"&gt;ILayerDescriptions&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Consolas;"&gt; layerDescriptions = mapDescription.LayerDescriptions;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #2b91af; font-size: 10pt; font-family: Consolas;"&gt;ILayerDescription&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Consolas;"&gt; layerDescription = layerDescriptions.get_Element(i);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000; font-size: 10pt; font-family: Consolas;"&gt;// get DefinitionExpression&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Consolas;"&gt;string&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Consolas;"&gt; definitionExpression = layerDescription.DefinitionExpression; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: 10pt; font-family: Consolas;"&gt;//retune nothing?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: 9.5pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;With ArcObjectSDK 10.0, the above line returns the expression specified in the mxd file for a layer,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;But with ArcObjectSDK 10.2.1, the property returns nothing.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;Has anyone seen the behaviour? Is this a bug in ArcObjectSDK 10.2.1 ILayerDescription.DefinitionExpression?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Thanks in advance.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Youmei Ge&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 18 Feb 2015 08:12:23 GMT</pubDate>
    <dc:creator>YoumeiGe</dc:creator>
    <dc:date>2015-02-18T08:12:23Z</dc:date>
    <item>
      <title>ILayerDescription.DefinitionExpression doesn't return expression set in mxd - ArcObject SDK 10.2.1</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/ilayerdescription-definitionexpression-doesn-t/m-p/733122#M19494</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;Hi all,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;After we upgraded our Server Object Extension from 10.0 to 10.2.1, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;it is found that &lt;SPAN style="mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi;"&gt;DefinitionExpression property doesn’t return the expression we set in the source mxd file. &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="mso-bidi-font-family: 'Times New Roman'; font-size: 10pt; mso-hansi-theme-font: minor-latin; font-family: arial,helvetica,sans-serif; mso-ascii-theme-font: minor-latin; mso-bidi-theme-font: minor-bidi;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="mso-bidi-font-family: 'Times New Roman'; font-size: 10pt; mso-hansi-theme-font: minor-latin; font-family: arial,helvetica,sans-serif; mso-ascii-theme-font: minor-latin; mso-bidi-theme-font: minor-bidi;"&gt;The code is below:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="mso-bidi-font-family: 'Times New Roman'; mso-hansi-theme-font: minor-latin; mso-ascii-theme-font: minor-latin; font-family: 'Calibri','sans-serif'; mso-bidi-theme-font: minor-bidi;"&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #2b91af; font-size: 10pt; font-family: Consolas;"&gt;IMapServerInfo&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Consolas;"&gt; mapServerInfo = mapServer.GetServerInfo(mapName);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #2b91af; font-size: 10pt; font-family: Consolas;"&gt;IMapDescription&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Consolas;"&gt; mapDescription = mapServerInfo.DefaultMapDescription;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #2b91af; font-size: 10pt; font-family: Consolas;"&gt;ILayerDescriptions&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Consolas;"&gt; layerDescriptions = mapDescription.LayerDescriptions;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #2b91af; font-size: 10pt; font-family: Consolas;"&gt;ILayerDescription&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Consolas;"&gt; layerDescription = layerDescriptions.get_Element(i);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000; font-size: 10pt; font-family: Consolas;"&gt;// get DefinitionExpression&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Consolas;"&gt;string&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Consolas;"&gt; definitionExpression = layerDescription.DefinitionExpression; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: 10pt; font-family: Consolas;"&gt;//retune nothing?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: 9.5pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;With ArcObjectSDK 10.0, the above line returns the expression specified in the mxd file for a layer,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;But with ArcObjectSDK 10.2.1, the property returns nothing.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;Has anyone seen the behaviour? Is this a bug in ArcObjectSDK 10.2.1 ILayerDescription.DefinitionExpression?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Thanks in advance.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Youmei Ge&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Feb 2015 08:12:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/ilayerdescription-definitionexpression-doesn-t/m-p/733122#M19494</guid>
      <dc:creator>YoumeiGe</dc:creator>
      <dc:date>2015-02-18T08:12:23Z</dc:date>
    </item>
    <item>
      <title>Re: ILayerDescription.DefinitionExpression doesn't return expression set in mxd - ArcObject SDK 10.2.1</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/ilayerdescription-definitionexpression-doesn-t/m-p/733123#M19495</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Youmei,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Apparently there &lt;EM&gt;was&lt;/EM&gt; a bug related to the DefinitionExpression method returning nothing: &lt;A href="http://support.esri.com/en/bugs/nimbus/TklNMDk0MDc1"&gt;NIM094075&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Supposedly it's fixed at 10.2.1 ... but maybe it's not.&amp;nbsp; You may want to contact Esri Support to verify.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Feb 2015 23:05:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/ilayerdescription-definitionexpression-doesn-t/m-p/733123#M19495</guid>
      <dc:creator>ErinBrimhall</dc:creator>
      <dc:date>2015-02-18T23:05:04Z</dc:date>
    </item>
  </channel>
</rss>

