Tag Info

Hot answers tagged

17

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


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


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

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


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


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

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

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

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' />", ...


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

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

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

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

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/


2

This is in fact possible with the OOTB paging. I found the solution by accident while working on a CrossList DVWP. The origin to the problem is changes that are made to several variables in the DVWP, probably by SPD when turning it into CrossList mode. An Easy way to get the paging working again is by adding the Grouping toolbar to the dataview from the ...


2

I believe this is what you are looking for Sorry for the powershell snippet, but it will be easy to test and easy to convert for usage in other api's # Add SharePoint PowerShell Snapin if ( (Get-PSSnapin -Name Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue) -eq $null ) { Add-PSSnapin Microsoft.SharePoint.Powershell } $web = Get-SPWeb ...


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


2

There is no way to extend CAML queries. You can see all the existing tokens and possible query elements here: CAML Query Schema (MSDN) Well, there are a couple of undocumented CAML Query attributes, but AFAIK nothing that can help in your case. But there are other possible solutions. Here I assume that you want to filter a list or a document library. ...


2

Just in case you will not be able to struggle through the "Join" thing, please consider those alternative solutions: 1. Separate queries Why not query the lists separately and then merge them manually? If you need to operate with the lists programmatically, I think this would be the best approach. First, select all items from the Accounts list (or filter ...


2

My understanding of how the List View Threshold works is limited, however, I suspect the reason your CAML query is failing is because it is filtering on the non-indexed field, and the RowLimit is applied "after". I think that indexing the CheckoutUser field would solve your problem, however it sounds like you have a lot of sites. Allow me to suggest an ...


2

Site columns in content types is a great way to group several columns in a meaningful (and reusable) way, and then attach the content types to the list. Having said that, you can define all the site columns in one file (Say SiteColumns.xml) and user FieldRef to reference them in your content types (say ContentTypes.xml). You can always ensure to activate ...


2

The thing is when you call clientContext.load(listItems,CS) you retrieve just particular set of columns - this doesn't include ListItemCollectionPosition. If you check the response in any http debugger you'll see that. If you need paging information and limit columns to just what you need I suggest you to use ViewFields sub-element of View element and not ...


2

It should look something like this (don't quote me because I haven't tested this): <Where> <Or> <Eq> <FieldRef Name="File_x0020_Type" /> <ValueType="Text">pdf</ValueType> </Eq> <Eq> <FieldRef Name="ContentTypeId" /> ...



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