0

I want to be able to check if (1 = 1) AND (2=2 OR 3=3)

this is the following code i've tried so far:

"<View>" +
"<Query>" +
"<Where>" +
"<And>" +
"<Eq><FieldRef Name='Title'/><Value Type='Text'>" + namn + "</Value></Eq>" +
"<Or>" +
"<Eq><FieldRef Name='Prioritet'/><Value Type='Text'>Hög</Value></Eq>" +
"<Eq><FieldRef Name='Status'/><Value Type='Text'>Startad</Value></Eq>" +
"</Or>" +
"</And>" +
"</Where>" +
"</Query>" +
"</View>");
  • Please put parenthesis in what you want to check. It's not possible to provide answer as it differs whether you want to do "(1 = 1 and 2=2) or 3=3" or "1 = 1 and (2=2 or 3=3)". Currently your query does "1 = 1 and (2=2 or 3=3)". – Jussi Palo Jun 4 '15 at 8:53
  • @JussiPalo edited! – Dr Cox Jun 4 '15 at 8:54
  • It looks good to me, you getting some error that query is malformed, or not the desired result? – Jussi Palo Jun 4 '15 at 8:55
  • @JussiPalo Failed to load resource: The server responded with a status of 403(forbidden) – Dr Cox Jun 4 '15 at 9:03
  • Issue is not with CAML, please post the surrounding code. – Jussi Palo Jun 4 '15 at 11:13
0

Remove the view and query tags from the CAML, are you facing any error?

 "<Where>" +
"<And>" +
"<Eq><FieldRef Name='Title'/><Value Type='Text'>" + namn + "</Value></Eq>" +
"<Or>" +
"<Eq><FieldRef Name='Prioritet'/><Value Type='Text'>Hög</Value></Eq>" +
"<Eq><FieldRef Name='Status'/><Value Type='Text'>Startad</Value></Eq>" +
"</Or>" +
"</And>" +
"</Where>"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.