CrossListQueryInfo how to specify lists instead of id's or types
-
10-12-2019 - |
Question
I have a question regarding the CrosListSueryInfo and how can i specify the name of the list instead of type or template or id ...
On msdn as example there is following:
CrossListQueryInfo crossListInfo = new CrossListQueryInfo();
crossListInfo.ViewFields = "<FieldRef Name=\"Title\" Nullable=\"True\" Type=\"Text\"/><FieldRef Name=\"FileRef\"/>";
crossListInfo.Query = "<Where><And><Eq><FieldRef Name=\"File_x0020_Type\"/><Value Type=\"Text\">aspx</Value></Eq>" +
"<Neq><FieldRef Name=\"ContentType\"/><Value Type=\"String\">Article Page</Value></Neq></And></Where>" +
"<OrderBy><FieldRef Name=\"Created\" Type=\"DateTime\" Ascending=\"True\"/></OrderBy>";
crossListInfo.RowLimit = 15;
crossListInfo.Webs = "<Webs Scope=\"Recursive\" />";
crossListInfo.Lists = "<Lists ServerTemplate=\"850\">";
crossListInfo.WebUrl = "/";
But they specify there a template, but i would like to say the list name/title.
I know i can also specify id, like that: <Lists ServerTemplate='100'><List ID='{ID}'/></Lists>
But i still need title, any idea how to do it?
And is it also possible to do with ContentTypeId?
Solution
I don't think it is possible to specify list titles. You can only specify list templates and list IDs.
Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange