使用" Microsoft.SharePoint.Client.ServerException",值不在预期范围内,

时间:2017-02-03 15:00:31

标签: sharepoint sharepoint-2013

我在sharepoint中使用连接查询。但是当我从Lookup列表中获得价值时,我似乎得到了一个错误。

这是我的设计

  • 作为文档库类型的文档具有Id

    Id | DocLeafRef
    ---+-------------
    1  | Document A
    2  | Document B
    
  • 活动列表,有一个外键' e8_document'对文档标识的引用

    Id | e8_document | Name
    ---+-------------+-----------
    1  | 1           | Activity A
    2  | 1           | Activity B
    3  | 1           | Activity C
    4  | 2           | Activity D
    

这是我需要得到的结果。

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

请问任何人请帮助我查询中的错误。这是我的查询

<View>
  <ViewFields>
    <FieldRef Name = 'DocLeafRef'/>
    <FieldRef Name = 'ID'/>
    <FieldRef Name = 'e8_document'/>
    <FieldRef Name = 'Title'/>
    <FieldRef Name = 'Author'/>
    <FieldRef Name = 'Created'/>
  </ViewFields>
  <Joins>
    <Join Type = 'INNER' ListAlias = 'Documents'>
      <Eq>
         <FieldRef Name ='e8_document' RefType = 'Id'/>
         <FieldRef Name ='ID' List ='Documents'/>
      </Eq>
    </Join>
  </Joins>
  <ProjectedFields>
    <Field ShowField ='FileLeafRef' Type ='Lookup' Name ='DocLeafRef' List ='Documents'/>
  </ProjectedFields>
  <Query>
     <Where>
        <Eq>
           <FieldRef Name='e8_caseId'></FieldRef>
           <Value Type = 'Number'>23</Value>
        </Eq>
     </Where>
  </Query>
</View>

这是例外 Value does not fall within the expected range

1 个答案:

答案 0 :(得分:1)

可能问题是FileLeafRef不是可以在投影字段中使用的字段类型之一。

请参阅文档here

  

ProjectedFields元素中只能包含以下类型的字段:

     

•计算(视为纯文本)

     

•ContentTypeId

     

•计数器

     

•货币

     

•日期时间

     

•的Guid

     

•整数

     

•注意(仅限一行)

     

•编号

     

•文本

相关问题