Tag Info

New answers tagged

1

In CAML query try to set LookupID attribute to TRUE value in FieldRef element. Replace <FieldRef Name="AssignedTo" /><Value Type="Integer"><UserID Type="Integer" /></Value> with <FieldRef Name="AssignedTo" LookupId="TRUE"/><Value Type="Integer"><UserID/></Value>


3

When building CAML query it is not possible to specify multiple conditions in logical And & Or operators because logical operators only takes 2 conditions. Read more here: http://buli.waw.pl/caml-query-multiple-conditions-in-and-or-clause/


0

Author is the internal name for a Created By field and the Managed Property named Author is mapped to the Crawled Property Author. It means Search Crawler extracts Created By field values and Search Index stores them in Author Managed Property


2

In SharePoint fields have display names and internal names. Created By or Modified By are display names of fields. Internal names are used when creating queries. Author is the internal name of Created By field and Editor is the internal name of Modified By field. UPDATE One way to check the internal name of a field from SharePoint UI is to go into List ...


1

For JavaScript - var query = new SP.CamlQuery(); query.set_viewXml("<Query><Where><And><Eq><FieldRef Name='column1' /><Value Type='Choice'>Bob</Value></Eq><Eq><FieldRef Name='column2' /><Value Type='Choice'>Marley</Value></Eq></And></Where></Query>");


1

There are several errors in the code you pasted. Are you trying to use SPQuery object to do the query? If that's the case, try this out: SPList myList = SPContext.Current.Web.TryGetList("MyListTitle"); SPQuery query = new SPQuery(); query.Query = @" <Where> <And> <Eq><FieldRef Name='Column1' /><Value ...


1

<Query><Where><And><Eq><FieldRef Name='column1' /><Value Type='Choice'>Bob</Value></Eq><Eq><FieldRef Name='column2' /><Value Type='Choice'>Marley</Value></Eq></And></Where></Query> Thats It. The fields you're selecting aren't specified in the Query itself, ...


1

Assuming column1 and column2 are choice columns, the query should be: <Query> <Where> <And> <Eq> <FieldRef Name='column1' /> <Value Type='Choice'>Bob</Value> </Eq> <Eq> <FieldRef Name='column2' /> <Value ...


0

Yep, Author is the Created By. Not sure why they named it the way they did.


0

For retrieving announcement items in descending order based on ID you should use only OrderBy query: spQuery.Query = "<OrderBy><FieldRef Name='ID' Ascending='FALSE'/></OrderBy>;


0

BTW, you haven't closed the FieldRef tag.


1

When you say "different XSLT Definition", do you mean the view or the XSL ? If you mean the view: XSLTListViewWebParts, if they're pointing to a list (because Document Libraries seem to act up apparently) can be pointed to one of the List's views. This way you don't have to define the view on the webpart. You can set it like so: webpart.ViewGuid = ...


0

I found a way to fix it. These queries are part of 4 Caml queries. I execute them one by one. My mistake was that I used the same SPQuery object. I just changed the Query property. What I didn't know was that after the first execution the SPQuery object stores some configuration data for faster querying.You can not just change the Query property and expect ...


0

The following example demonstrates how to retrieve an additional information about selected items: function getSelectedItems(success,error) { var context = SP.ClientContext.get_current(); var listId = SP.ListOperation.Selection.getSelectedList(); //selected list Id var selectedItemIds = SP.ListOperation.Selection.getSelectedItems(context); ...


0

You don't necessarily have to call Caml Query inside loop to get the FileLeafRef here since you already know the IDs of the Documents. You can use SP.List.getItemById(id) method.Please see below code to give you an idea of how to start with: items = []; function getSetListItem() { var clientContext = SP.ClientContext.get_current(); ...


1

Have you tried something like this? <Query> <Where> <Eq> <FieldRef Name='ID' /> <Value Type='Number'>{YourIdGoesHere}</Value> </Eq> </Where> <OrderBy><FieldRef Name='FileLeafRef' /></OrderBy> </Query> <ViewFields> <FieldRef Name='ID' ...


0

You can use <Today /> tag for comparing current date.Below is the code: var q = "<Where><Leq><FieldRef Name='Start Date' /><Value Type='DateTime' IncludeTimeValue='FALSE'><Today /></Value></Leq></Where>";


0

based on experience of the error, its due to the internal name being wrong! goto list settings, click on the field in question, it should take you to the edit page for the field. look at the url should be somthing like: http://mysite:40669/_layouts/15/FldEdit.aspx?List=%7BE072EA9D%2D1D1F%2D4B95%2D8A8C%2D7CE83142D736%7D&Field=Group%5Fx0020%5Fhome my ...



Top 50 recent answers are included