簡體   English   中英

SharePoint - 在GetListItems SOAP調用上執行用戶查找

[英]SharePoint - Doing a user lookup on GetListItems SOAP call

我正在使用jQuery和WSS 3.0 SOAP服務來檢索和顯示列表中的數據。 我想通過CreatedBy列過濾數據。 這是我的CAML查詢:

<Query>
<Where>
    <And>
        <Leq>
            <FieldRef Name="Created" />
            <Value Type="DateTime" IncludeTimeValue="FALSE">2011-1-8</Value>
        </Leq>
        <Geq>
            <FieldRef Name="Created" />
            <Value Type="DateTime" IncludeTimeValue="FALSE">2011-1-2</Value>
        </Geq>
        <Contains>
            <FieldRef Name="CreatedBy" LookupId="TRUE" />
            <Value Type="User">Smith</Value>
        </Contains>
    </And>
</Where>

執行此操作時,SharePoint返回以下錯誤:

0x80004005 - 無法完成此操作。 請再試一次。

刪除用戶查找可解析頒發者。 我哪里錯了?

如果要使用其顯示名稱,則不能使用LookupId="TRUE"Type="User" 它應該是:

<Contains>
   <FieldRef Name="CreatedBy" />
   <Value Type="Text">Smith</Value>
</Contains>

有關更多示例,請參閱我的答案

編輯:

另外,我剛注意到你的<And></And>節點包含三個子節點。 每個只能包含兩個,這意味着你需要這樣的東西:

<Where>
  <And>
    <And>
      <Leq>
        <FieldRef Name="Created" />
        <Value Type="DateTime" IncludeTimeValue="FALSE">2011-1-8</Value>
      </Leq>
      <Geq>
        <FieldRef Name="Created" />
        <Value Type="DateTime" IncludeTimeValue="FALSE">2011-1-2</Value>
      </Geq>
    </And>
    <Contains>
      <FieldRef Name="CreatedBy" />
      <Value Type="Text">Smith</Value>
    </Contains>
  </And>
</Where>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM