Answered by:
CAML Query

Question
-
Hi,
we have a requirement to generate view based on the following conditions
there are 4 sets of seven conditions each, there should be "and" between the first condtion and or between the rest of six condtions.
each set should have or between them, can we build this query using CAML?
Friday, August 26, 2011 11:47 AM
Answers
-
Hi,
I would suggest you to use CAML Query builder for creating and testing complex queries.
http://www.u2u.net/res/Tools/SharePointCamlQueryBuilder.aspx
Regards,
Geetanjali
Thanks & Regards, Geetanjali Arora- Marked as answer by Rsiripr Thursday, August 30, 2012 3:55 AM
Friday, August 26, 2011 12:30 PM -
Also refer the tools from CodePlex
http://sharepointcamlhelper.codeplex.com/
http://spcamlviewer.codeplex.com/
--Cheers- Marked as answer by Rsiripr Thursday, August 30, 2012 3:55 AM
Friday, August 26, 2011 2:17 PM -
The U2U CAML Builder tool will help you right this query. Suggesting other tools doesn't help answer the question (unless these tools have advantages over the ones already suggested).
My SharePoint Blog - http://www.davehunter.co.uk/blog Twitter - @davehunter- Marked as answer by Rsiripr Thursday, August 30, 2012 3:55 AM
Friday, August 26, 2011 2:23 PM -
Hi,
I think you should crate dynamic CAMl query here. I can think two options here:
1. If your conditions (AND or OR) are static then use CAML builder and generate the CAML query for all 28 conditions.
Here is the link for downloading CAML builder
http://www.u2u.net/res/Tools/CamlQueryBuilder.aspx
2. You can append your query string using Stringbuilder and generate the CAML query.This will be better options because if you need to add more condition later on then this way will be more helpful.
http://sadomovalex.blogspot.com/2010/06/build-dynamic-caml-queries-based-on.html
http://blog.mastykarz.nl/dynamic-caml-query/
Hope it could help
Cheers, Hemendra-MCTS "Yesterday is just a memory,Tomorrow we may never see"- Marked as answer by Qiao Wei Friday, September 2, 2011 1:04 AM
Tuesday, August 30, 2011 6:31 AM
All replies
-
Hi,
I would suggest you to use CAML Query builder for creating and testing complex queries.
http://www.u2u.net/res/Tools/SharePointCamlQueryBuilder.aspx
Regards,
Geetanjali
Thanks & Regards, Geetanjali Arora- Marked as answer by Rsiripr Thursday, August 30, 2012 3:55 AM
Friday, August 26, 2011 12:30 PM -
Also refer the tools from CodePlex
http://sharepointcamlhelper.codeplex.com/
http://spcamlviewer.codeplex.com/
--Cheers- Marked as answer by Rsiripr Thursday, August 30, 2012 3:55 AM
Friday, August 26, 2011 2:17 PM -
The U2U CAML Builder tool will help you right this query. Suggesting other tools doesn't help answer the question (unless these tools have advantages over the ones already suggested).
My SharePoint Blog - http://www.davehunter.co.uk/blog Twitter - @davehunter- Marked as answer by Rsiripr Thursday, August 30, 2012 3:55 AM
Friday, August 26, 2011 2:23 PM -
Hi Geetanjali,
Thanks for your response, our requirement is to have 28 conditions in the view , to configure this tool we have to use the OOB view which does not allow you to have more than 10 conditions.
Monday, August 29, 2011 5:19 AM -
Hi,
I think you should crate dynamic CAMl query here. I can think two options here:
1. If your conditions (AND or OR) are static then use CAML builder and generate the CAML query for all 28 conditions.
Here is the link for downloading CAML builder
http://www.u2u.net/res/Tools/CamlQueryBuilder.aspx
2. You can append your query string using Stringbuilder and generate the CAML query.This will be better options because if you need to add more condition later on then this way will be more helpful.
http://sadomovalex.blogspot.com/2010/06/build-dynamic-caml-queries-based-on.html
http://blog.mastykarz.nl/dynamic-caml-query/
Hope it could help
Cheers, Hemendra-MCTS "Yesterday is just a memory,Tomorrow we may never see"- Marked as answer by Qiao Wei Friday, September 2, 2011 1:04 AM
Tuesday, August 30, 2011 6:31 AM