Tag Info

Hot answers tagged

20

CAML Designer The one that works is this URL: http://sharepoint.biwug.be/CamlDesigner/CamlDesigner.zip The link comes from Karine Bosch's Blog. CAML Designer is the successor of CAML Builder, and from experience I can tell you this tool is much better and accurate. I've tried the both. CAML Builder But if you want the previous tool, the page to turn to ...


9

CAML queries are NOT vulnerable to SQL injection. I don't think you'll find any direct reference or proof. Consider that the conversion from CAML to SQL all happens between the data layer and the SharePoint API. You can't control how SharePoint generates the SQL for a given CAML statement and therefore you don't have to worry about SQL injection. That's ...


8

It is more a caml question than an SPServices question. Often one uses or and and operators to combine multiple values, which, like @rjcp3 said, can be messy. There is another operator, less known, IN operator to choose a range of values (see the xml example below). To simplify the creation of CAML queries in javascript, I'd recommend SharePoint ...


8

Try to use this caml: <Where> <Eq> <FieldRef Name="Author" LookupId="True" /> <Value Type="User">123</Value> </Eq> </Where> this also might work, but first is preferable: <Where> <Eq> <FieldRef Name="Author" LookupId="True" /> <Value Type="Lookup">123</Value> ...


7

First of all you should just rule out the use of SQL. You should not use SQL directly against SharePoint content databases. If you ever do modifications directly using SQL that SharePoint Farm becomes unsupported for ever. Even just doing reads makes your SharePoint Farm unsupported as long as they are occuring and may cause any kind of problems as ...


7

<OrderBy> <FieldRef Name='Region' Ascending='True' /> <FieldRef Name='Location' Ascending='True' /> </OrderBy> Should be the correct syntax for the order by clause.


6

Yes, it's your nesting. Try this: <Where> <And> <Eq><FieldRef Name="Status" /><Value Type="Text">A</Value></Eq> <And> <Eq><FieldRef Name="Region" /><Value Type="Text">B</Value></Eq> <And> <Eq><FieldRef Name="BagVal" /><Value ...


5

You should use the Internal Name of the column, so its probably: Link_x0020_to_x0020_Page Easy way to check the internal name is from the url when you edit the column, and check the "Field=" part of the URL: FldEdit.aspx?List=%7B6045095F%2DC5AF%2D47D5%2DA481%2D27665B46E343%7D&Field=Link%5Fx0020%5Fto%5Fx0020%5FPage Replace %5F with underscore, or ...


5

One oddity about the JSOM is that you need to wrap the CAML query in a <View> tag. var proproductIDVal = "TR543A1Z"; var queryXml = "<View><Query><Where><Eq><FieldRef Name = 'ProjectID'/><Value Type='Text'>" + productIDVal + "</Value></Eq></Where></Query></View>"; var query = new ...


4

To achieve this, You can use ListItemCollectionPosition property. It is used together with the RowLimit property to define paging in a query. For your reference, see the sample code available this link http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spquery.listitemcollectionposition.aspx I hope this will resolve your problem.


4

<Where> <And> <Eq><FieldRef Name="IssueLOB" LookupId="TRUE" /><Value Type="Lookup">1</Value></Eq> <And> <Eq><FieldRef Name="IssueBucket" LookupId="TRUE" /><Value Type="Lookup">1</Value></Eq> <Eq><FieldRef Name="IssueStatus" LookupId="TRUE" /><Value ...


4

Try this: splist li = web.lists["Films"]; spquery q = new spquery(); q.Query=""; //Enter a caml query here if you would like to restrict your results... q.ViewFields = string.Concat( "<FieldRef Name='FilmID' />", "<FieldRef Name='FilmName' />", ...


4

To solve this issue, just remove the <Query> and </Query> tags from the CAML query it should all work.


4

When using you want to use the Offset=""(or according to the comments on MSDN attribute should be OffsetDays="") on the Element <View> <Query> <Where> <Eq> <FieldRef Name="EventDate" /> <Value Type="DateTime"><Today OffsetDays="+1"/></Value> ...


3

Remove <Query> and </Query> from your string


3

What about approaching it from the other end of the solution? If users are clicking a link of some kind to get to this view (is it a data view web part?), you could use JavaScript (which can handle date offsets relatively easily) to append a query string with the start date and end date of the range you need, and use both of those parameters in your CAML ...


3

Paging in SPQuery is implemented through the class SPListItemCollectionPosition. The SPListItemCollection returned by SPQuery.GetItems contains a ListItemCollectionPosition property which is null if no more pages and otherwise can be used assigned to the corresponding property in SPQuery before a new call to GetItems. (Sample at the link above)


3

If ArticlePriority is a choice column then null values will be sorted before the ones with values. One solution could be to create a hidden calculated column with the formular something like =IF(ArticlePriority=0,9999,ArticlePriority) and then order by that column


3

You should write query like below: <Where> <And> <Or> <Eq><FieldRef Name="X" /><Value Type="Text">A</Value></Eq> <Eq><FieldRef Name="X" /><Value Type="Text">B</Value></Eq> </Or> <Eq><FieldRef Name="X" /><Value ...


3

Yes definitely it will be faster, as less items will be retrieved and stored in memory. Here's sample code, public void SaveFolderFiles(string fileName, string libraryName, ClientOM.ClientContext clientContext) { ClientOM.List sharedDocumentsList = clientContext.Web.Lists.GetByTitle(libraryName); ClientOM.CamlQuery camlQuery = new ...


3

AssignedTo should be replaced with Author and you should then see all your items.


3

U2U CAML Query Builder is now available again and updated for SharePoint 2013: http://www.u2u.be/Software You can also check out these alternatives: Stramit Caml Viewer SharePoint CAML Query Helper Caml Designer for SP 2010 and SP 2013 CAML Generator (taken from my post on Stackoverflow)


3

Frank, I don't think it's possible to do what you want. If search returned all of the versions, we'd have a real mess on our hands. You're right that the Author (Created By) is the original creator and the Editor (Modified By) is the last person who made an update. To add to the complexity, those roles may have only made changes to metadata and not the ...


3

If you want to develop applications that works a lot with lists and list items, CAML is in many cases crucial. Not only does it have better performance than alternative solutions (like say LINQ or loops), once you grasp it it is very easy to filter and order data (and to only retrieve the fields that you need) which in turn means less data transfer and ...


3

CAML isn't going to strip out that div as it's part of the column data. You are going to need to use a regex to strip that out after the data has been retrieved.


3

Add after </Where> <QueryOptions> <ViewAttributes Scope="RecursiveAll" /> </QueryOptions> Reference: Need a CAML query to "show all items without folders" in sharepoint list view.


3

CAML can be used in various ways to customize a SharePoint site, including the following: In script or code that implements members of the SharePoint Foundation object model, where CAML strings are passed through method parameters, assigned to properties, or returned by methods and properties In SOAP messaging that passes CAML strings to a SharePoint ...


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/


3

Your <And> tag is in all caps; CAML is case sensitive. Try this: <Where> <And> <Neq> <FieldRef Name="marking" /> <Value Type="Text">Off-S</Value> </Neq> <Neq> <FieldRef Name="marking" /> <Value ...


2

Instead of using U2U CAML Query Builder in a lot of cases it's easier to build the query by creating a view using the SharePoint UI. When you get the view right the use SharePoint Manager to look at the Query of the View. In case of the status of the Approval workflow it may be a little complicated as what you want to check for isn't the text Appoved, but ...



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