title: FetchXML View to Include Attributes from Nested Link-Entity
body: <p>I would like to have a view that show attributes from 3 entities:<br>
  Statistics has a lookup to Account and Account has a lookup to Address.<br>
  <br>
  The view is on Statistics and I want attributes from all 3 entities; is this even possible?</p>
  
  <p>The problem is with the GridXML.<br>
  I want to include the attribute wl_city in the GridXML.<br></p>
  
  <p>This is the FetchXML with link-entities:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;fetchxml&gt;
    &lt;fetch version="1.0" output-format="xml-platform" mapping="logical"&gt;
      &lt;entity name="sb_statistics"&gt;
        &lt;order attribute="sb_amount" descending="false" /&gt;
        &lt;!-- It is easy to get these into the GridXML --&gt;
        &lt;attribute name="sb_debtor" /&gt;
        &lt;attribute name="sb_date" /&gt;
        &lt;attribute name="sb_amount" /&gt;
        &lt;link-entity name="account" from="accountid" to="sb_debtor" 
         alias="relatedAccount" link-type="outer"&gt;
          &lt;!-- It is possible to get this into the GridXML
               by using the link-entity alias: relatedAccount.wl_towncity --&gt;
          &lt;attribute name="wl_towncity" /&gt;
          &lt;link-entity name="wl_postalcode" from="wl_postalcodeid" 
            to="wl_postaltowncity" alias="relatedAddress" link-type="outer"&gt;
            &lt;!-- I have trouble getting this attribute into the GridXML --&gt;
            &lt;attribute name="wl_city" /&gt;
          &lt;/link-entity&gt;
        &lt;/link-entity&gt;
        &lt;attribute name="sb_statisticsid" /&gt;
      &lt;/entity&gt;
    &lt;/fetch&gt;
  &lt;/fetchxml&gt;
  </code></pre>
  
  <p>When I change the GridXML as below this error is displayed when the view is opened:<br>
  "To use this saved query, you must remove criteria and columns that refer to deleted or non-searchable items"</p>
  
  <pre class="lang-xml prettyprint-override"><code>  &lt;layoutxml&gt;
      &lt;grid name="resultset" object="10008" jump="sb_name" select="1" preview="1" 
       icon="1"&gt;
        &lt;row name="result" id="sb_statisticsid" multiobjectidfield="1"&gt;
          &lt;cell name="sb_amount" width="100" /&gt;
          &lt;cell name="sb_date" width="100" /&gt;
          &lt;cell name="sb_debtor" width="100" /&gt;
          &lt;cell name="relatedAccount.relatedAddress.wl_city" width="100" /&gt;
        &lt;/row&gt;
      &lt;/grid&gt;
    &lt;/layoutxml&gt;
  </code></pre>
  
  <p>The below GridXML shows this error when the view is opened:<br>
  "<strong>Unexpected Error</strong> An error has occured".</p>
  
  <pre class="lang-xml prettyprint-override"><code>  &lt;layoutxml&gt;
      &lt;grid name="resultset" object="10008" jump="sb_name" select="1" preview="1" 
       icon="1"&gt;
        &lt;row name="result" id="sb_statisticsid" multiobjectidfield="1"&gt;
          &lt;cell name="sb_amount" width="100" /&gt;
          &lt;cell name="sb_date" width="100" /&gt;
          &lt;cell name="sb_debtor" width="100" /&gt;
          &lt;cell name="relatedAddress.wl_city" width="100" /&gt;
        &lt;/row&gt;
      &lt;/grid&gt;
    &lt;/layoutxml&gt;
  </code></pre>
  
  <p>The GridXML below results in this error being shown when the view is opened:<br>
  "To use this saved view, you must remove criteria and columns that refer to deleted or non-searchable columns".</p>
  
  <pre class="lang-xml prettyprint-override"><code>  &lt;layoutxml&gt;
      &lt;grid name="resultset" object="10008" jump="sb_name" select="1" preview="1" 
       icon="1"&gt;
        &lt;row name="result" id="sb_statisticsid" multiobjectidfield="1"&gt;
          &lt;cell name="sb_amount" width="100" /&gt;
          &lt;cell name="sb_date" width="100" /&gt;
          &lt;cell name="sb_debtor" width="100" /&gt;
          &lt;cell name="wl_city" width="100" /&gt;
        &lt;/row&gt;
      &lt;/grid&gt;
    &lt;/layoutxml&gt;
  </code></pre>
  
  <p>This saved query works, but it only includes attributes from the primary entity and the first link-entity.</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;savedquery&gt;
    &lt;IsCustomizable&gt;1&lt;/IsCustomizable&gt;
    &lt;CanBeDeleted&gt;0&lt;/CanBeDeleted&gt;
    &lt;isquickfindquery&gt;0&lt;/isquickfindquery&gt;
    &lt;isprivate&gt;0&lt;/isprivate&gt;
    &lt;isdefault&gt;0&lt;/isdefault&gt;
    &lt;returnedtypecode&gt;10008&lt;/returnedtypecode&gt;
    &lt;savedqueryid&gt;{df101ac4-2e4d-e311-9377-005056bd0001}&lt;/savedqueryid&gt;
    &lt;layoutxml&gt;
      &lt;grid name="resultset" object="10008" jump="sb_name" select="1" preview="1" 
       icon="1"&gt;
        &lt;row name="result" id="sb_statisticsid" multiobjectidfield="1"&gt;
          &lt;cell name="sb_amount" width="100" /&gt;
          &lt;cell name="sb_date" width="100" /&gt;
          &lt;cell name="sb_debtor" width="100" /&gt;  
          &lt;cell name="relatedAccount.wl_city" width="100" /&gt;              
        &lt;/row&gt;
      &lt;/grid&gt;
    &lt;/layoutxml&gt;
    &lt;querytype&gt;0&lt;/querytype&gt;
    &lt;fetchxml&gt;
      &lt;fetch version="1.0" output-format="xml-platform" mapping="logical"&gt;
        &lt;entity name="sb_statistics"&gt;
          &lt;order attribute="sb_amount" descending="false" /&gt;
          &lt;attribute name="sb_debtor" /&gt;
          &lt;attribute name="sb_date" /&gt;
          &lt;attribute name="sb_amount" /&gt;
          &lt;link-entity name="account" from="accountid" to="sb_debtor" 
           alias="relatedAccount" link-type="outer"&gt;
            &lt;attribute name="wl_towncity" /&gt;
            &lt;link-entity name="wl_postalcode" from="wl_postalcodeid" 
             to="wl_postaltowncity" alias="relatedAddress" link-type="outer"&gt;
              &lt;attribute name="wl_city" /&gt;
            &lt;/link-entity&gt;
          &lt;/link-entity&gt;
          &lt;attribute name="sb_statisticsid" /&gt;
        &lt;/entity&gt;
      &lt;/fetch&gt;
    &lt;/fetchxml&gt;
    &lt;LocalizedNames&gt;
      &lt;LocalizedName description="Statistics and Address" languagecode="1033" /&gt;
    &lt;/LocalizedNames&gt;
  &lt;/savedquery&gt; 
  </code></pre>
  
  <p>Is GridXML limited to showing only attributes from the primary entity and the first link-entity?</p>