1

Is there something wrong with this query?

camlQuery.set_viewXml('<View><Query><Where><Eq><FieldRef Name=\'Eenheid\'/><Value Type=\'Text\'>" + myUnit + "</Value></Eq></Where><OrderBy><FieldRef Name=\'Volgnr\' Ascending=\'False\' /></OrderBy></Query><RowLimit>1</RowLimit></View>');

I like to get the last record from my list where the value of "Eenheid" is myUnit. Orderedby Volgnr.

  • what's the issue ? Query seems to be fine – Gautam Sheth Jun 26 '18 at 11:45
  • It's not returning anything. When I change to my old query it does: camlQuery.set_viewXml('<View><Query><OrderBy><FieldRef Name=\'Volgnr\' Ascending=\'False\' /></OrderBy></Query><RowLimit>1</RowLimit></View>'); – Marco Jun 26 '18 at 11:54
3

Please try below code. I have changed double quotes in your provided code:

camlQuery.set_viewXml("<View><Query><Where><Eq><FieldRef Name=\'Eenheid\'/><Value Type=\'Text\'>" + myUnit + "</Value></Eq></Where><OrderBy><FieldRef Name=\'Volgnr\' Ascending=\'False\' /></OrderBy></Query><RowLimit>1</RowLimit></View>");

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.