标签: caml

CAML查询未正确排序

任何人都可以帮我解决这个CAML查询吗?当我翻转Ascending从属性TRUEFALSE(也试过TrueFalse),它不会重新排序的结果集.

CAML的其余部分是正确的,它由工具生成,并返回适当的结果.

<Where>
  <And>
    <And>
      <Eq>
        <FieldRef Name="Branch"/>
        <Value Type="Text">Camp 1</Value>
      </Eq>      
      <Eq>
        <FieldRef Name="Type"/>
        <Value Type="Choice">Day</Value>
      </Eq>
    </And>
    <Geq>
      <FieldRef Name="StartDateTime"/>
      <Value Type="DateTime">2009-01-05T00:00:00Z</Value>
    </Geq>
  </And>
  <OrderBy>
    <FieldRef Ascending="TRUE" Name="Title" />
  </OrderBy>
</Where>
Run Code Online (Sandbox Code Playgroud)

sharepoint caml

2
推荐指数
1
解决办法
8574
查看次数

检索SharePoint站点的所有母版页?

如何以编程方式确定哪些主页(自定义和OOTB)可用于SharePoint中的网站?

谢谢,MagicAndi

api sharepoint moss sharepoint-2007 caml

2
推荐指数
1
解决办法
2718
查看次数

具有多个条件的CAML IN运算符和AND运算符

以下CAML查询对我不起作用..我对sharepoint平台了解不多.我正在使用SP 2007并尝试​​使用IN运算符进行查找字段.

"<Where>"
                                + "<And>"
                                + "<And>"
                                + "<In>"
                                + "<FieldRef Name='Role'/>"
                                + "<Values>"
                                + "<Value Type = 'Text'>A</Value>"
                                + "<Value Type = 'Text'>B</Value>"
                                + "</Values>"
                                + "</In>"
                                + "<Leq>"
                                + "<FieldRef Name='Enddate'/><Value Type = 'DateTime'>" + SPUtility.CreateISO8601DateTimeFromSystemDateTime(Dt) + " </Value>"
                                + "</Leq>"
                                + "</And>"
                                + "<Includes>"
                                + "<FieldRef Name='Menu'/><Value Type='Text'>Benefits</Value>"
                                + "</Includes>"
                                + "</And>"
                                + "</Where>";
Run Code Online (Sandbox Code Playgroud)

上面的查询没有返回任何内容,但我的列表中有上述组合的值.

如果我稍微修改查询,如下面的w/o使用IN然后它工作正常.

"<Where>"
                                + "<And>"
                                + "<And>"
                                + "<Eq>"
                                + "<FieldRef Name='Role'/>"
                                //+ "<Values>"
                                + "<Value Type = 'Text'>A</Value>"
                                //+ "<Value Type = …
Run Code Online (Sandbox Code Playgroud)

sharepoint sharepoint-2007 caml

2
推荐指数
1
解决办法
1万
查看次数

对sharepoint的C#CAML查询返回列表中的所有项目(而不是仅查找mach查询值的项目)

我的应用程序中有以下代码从sharepoint列表中提取详细信息.

            string siteUrl = "http://SHAREPOINTURL";

        ClientContext clientContext = new ClientContext(siteUrl);
        clientContext.Credentials = new NetworkCredential("UN", "PW", "DOMAIN");
        SP.List oList = clientContext.Web.Lists.GetByTitle("Licences");

        CamlQuery camlQuery = new CamlQuery();
        camlQuery.ViewXml = "<Where><Eq><FieldRef Name='Account' /><Value Type='Text'>123456</Value></Eq></Where>";

        ListItemCollection collListItem = oList.GetItems(camlQuery);
        clientContext.Load(collListItem);
        clientContext.ExecuteQuery();

        Console.WriteLine("Filtered List: " + collListItem.Count.ToString() + "\n");
        foreach (ListItem oListItem in collListItem)
        {
            Console.WriteLine("Account: {0} \nLicence: {1} \nMAC: {2}\n", oListItem["Account"], oListItem["Licence"], oListItem["MAC"]);
        }
Run Code Online (Sandbox Code Playgroud)

在sharepoint列表中,我创建了多个测试项,但每次运行上面的代码时,无论我使用什么用于camlQuery,都会返回列表中的所有项.

任何人都可以让我知道我对C#这个新手的错误,并且在此之前从未触及过sharepoint.

Edit1:根据以下建议更新.

Edit2:简化了代码但仍然遇到了同样的问题.

c# sharepoint caml

2
推荐指数
1
解决办法
2万
查看次数

SharePoint CAML查询AND/OR运算符

我很感激有关使我的CAML查询工作的任何帮助.我有以下列表:

| ID | Department | Status |
Run Code Online (Sandbox Code Playgroud)

我试图让查询返回 list items where ID=1, Department=Audit, and Status= "Stopped" OR "In Progress".

有人可以帮忙吗?

问候,

caml sharepoint-2010

2
推荐指数
1
解决办法
1万
查看次数

Sharepoint动态caml查询问题?

我想基于查询字符串动态caml查询.让我用例子解释一下

我的查询刺痛可以是任何东西

?cat=ABC&cat=ABD&cat=ABE...
?Cat=ABC
?Cat=ABC&cat=ABL
Run Code Online (Sandbox Code Playgroud)

所以不行.现在可以解决问题了

我想根据此查询字符串查询我的sharepoint列表

if (HttpContext.Current.Request.QueryString["cat"] != null)
        {
            string _cat = HttpContext.Current.Request.QueryString["cat"].ToString();
        }
Run Code Online (Sandbox Code Playgroud)

所以这样我的字符串包含所有查询

string _cat=ABC,AD,....all.
Run Code Online (Sandbox Code Playgroud)

我想根据这些查询字符串和"AND"查询我的sharepoint列表

where title=ABC and title=AD ....
Run Code Online (Sandbox Code Playgroud)

如果只有一个查询字符串,那么只有title=ABC....所以我希望我的查询字符串应该是动态的...任何想法如何实现这一点?

c# sharepoint caml

1
推荐指数
1
解决办法
1万
查看次数

在SPList中查询日期时间字段

你能告诉我如何使用CAML查询将存储在SPList中的日期和时间作为DateTime字段与当前系统时间进行比较吗?

sharepoint caml splist

0
推荐指数
1
解决办法
1696
查看次数

可以从共享点列表中获取所需的列吗?

我正在使用以下Caml查询从共享点列表中获取数据。

    oSb.Append("         <OrderBy>")
    oSb.Append("              <FieldRef Name=""Title"" />")
    oSb.Append("         </OrderBy>")
Run Code Online (Sandbox Code Playgroud)

但是这个查询给了我列表的所有列。有没有办法使用Caml Query从共享点列表中仅获取所需的列?请帮我。

vb.net sharepoint caml

0
推荐指数
1
解决办法
1257
查看次数

标签 统计

caml ×8

sharepoint ×7

c# ×2

sharepoint-2007 ×2

api ×1

moss ×1

sharepoint-2010 ×1

splist ×1

vb.net ×1