【问题标题】:SharePoint - Doing a user lookup on GetListItems SOAP callSharePoint - 对 GetListItems SOAP 调用进行用户查找
【发布时间】:2011-01-06 20:43:31
【问题描述】:

我正在使用 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 - 无法完成此操作。请再试一次。

删除用户查找可解决问题。我哪里错了?

【问题讨论】:

    标签: javascript sharepoint soap wss-3.0


    【解决方案1】:

    如果您想使用他们的显示名称,那么您不能使用LookupId="TRUE"Type="User"。应该是:

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

    更多示例请参见my answer here

    编辑:

    另外,我刚刚注意到您的 &lt;And&gt;&lt;/And&gt; 节点包含三个子节点。每个只能包含两个,这意味着您需要这样的东西:

    <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>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-11-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多