Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

CAML Query with Javascript value

$
0
0

Hey everyone,

I am building an Sharepoint 2013 app (SharePoint-Hosted) and using a CAML Query to get the current Item.

The Current Item ID is 1 and i stored it in AccountID, but i want that variable inserted in the CAML Query so i get the proper information.

var AccountID = 1

camlQuery.set_viewXml('<View><Query><Where><Eq><FieldRef Name=ID LookupId="TRUE"/><Value Type="Text">1</Value></Eq></Where></Query></View>');


But instead of putting the '1' value in the CAML Query, i want the variable AccountID in it... but how?

Already tried this, but that didn't work:

camlQuery.set_viewXml('<View><Query><Where><Eq><FieldRef Name=ID LookupId="TRUE"/><Value Type="Text">' + AccountID + '</Value></Eq></Where></Query></View>');

Can someone help me with this?

In forward, many thanks!



Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>