Tag Info

Hot answers tagged

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/


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


2

About the first one: since it is a note field, I suppose that that is the actual content of the field. SharePoint automagically formatted your text when you inserted it into the list. About the second one. Again, expected. The user will be returned as an instance of the FieldUserValue class. Cast it to read the actual info. For example: //Note: will give ...


1

For such complex cases you might need to create DataContext and use Linq to SharePoint.. SPMetal command utility is used to create .CS code file for Entity Context.. Using this generated class you can easily query using LINQ.. Have a look at these: Using LINQ to SharePoint How to: Query Using LINQ to SharePoint


1

For the user you need to get the LookupValue property and then use toString(). objFieldUserValue.LookupValue.ToString(); Microsoft.SharePoint.Client.FieldUserValue Title For the NoteField try to get the property Text. NoteField properties


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>


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


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


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



Only top voted, non community-wiki answers of a minimum length are eligible