title: Value does not fall within the expected range with "Microsoft.SharePoint.Client.ServerException",
body: <p>I use the join query in sharepoint. but it's seem i get an error on the  when i get value from the Lookup lists.</p>
  
  <p>Here is my design</p>
  
  <ul>
  <li><p>Document as a Document Library type have a Id</p>
  
  <pre><code>Id | DocLeafRef
  ---+-------------
  1  | Document A
  2  | Document B
  </code></pre></li>
  <li><p>Activities list, have a foreign key 'e8_document' that reference to the Document Id</p>
  
  <pre><code>Id | e8_document | Name
  ---+-------------+-----------
  1  | 1           | Activity A
  2  | 1           | Activity B
  3  | 1           | Activity C
  4  | 2           | Activity D
  </code></pre></li>
  </ul>
  
  <p>Here is the result that I need to get.</p>
  
  <pre><code>Id | e8_document | Name       | DocLeafRef
  ---+-------------+--------------------------
  1  | 1           | Activity A | Document A
  2  | 1           | Activity B | Document A
  3  | 1           | Activity C | Document A
  4  | 2           | Activity D | Document B
  </code></pre>
  
  <p>Could any one please help me what's wrong in my query. Here is my query</p>
  
  <pre><code>&lt;View&gt;
    &lt;ViewFields&gt;
      &lt;FieldRef Name = 'DocLeafRef'/&gt;
      &lt;FieldRef Name = 'ID'/&gt;
      &lt;FieldRef Name = 'e8_document'/&gt;
      &lt;FieldRef Name = 'Title'/&gt;
      &lt;FieldRef Name = 'Author'/&gt;
      &lt;FieldRef Name = 'Created'/&gt;
    &lt;/ViewFields&gt;
    &lt;Joins&gt;
      &lt;Join Type = 'INNER' ListAlias = 'Documents'&gt;
        &lt;Eq&gt;
           &lt;FieldRef Name ='e8_document' RefType = 'Id'/&gt;
           &lt;FieldRef Name ='ID' List ='Documents'/&gt;
        &lt;/Eq&gt;
      &lt;/Join&gt;
    &lt;/Joins&gt;
    &lt;ProjectedFields&gt;
      &lt;Field ShowField ='FileLeafRef' Type ='Lookup' Name ='DocLeafRef' List ='Documents'/&gt;
    &lt;/ProjectedFields&gt;
    &lt;Query&gt;
       &lt;Where&gt;
          &lt;Eq&gt;
             &lt;FieldRef Name='e8_caseId'&gt;&lt;/FieldRef&gt;
             &lt;Value Type = 'Number'&gt;23&lt;/Value&gt;
          &lt;/Eq&gt;
       &lt;/Where&gt;
    &lt;/Query&gt;
  &lt;/View&gt;
  </code></pre>
  
  <p>And here is the exception
  <a href="https://i.stack.imgur.com/kkXpP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kkXpP.png" alt="Value does not fall within the expected range"></a></p>