I have a List called ProjectInformation and contains following Fields..
ID ProjectName1 ProjectManager ProjectExecution
1 EDS PPB Time and Material
2 CS PQR Fixed Price
I want to retrieve single field as we can do in SQL as :
Select ProjectExecution from ProjectInformation where ProjectName1 ='EDS'
How in CAML Query..??
**My Code **
function rtsample(){
document.getElementById("tbl").style.visibility="hidden";
var cc = SP.ClientContext.get_current();
var alllist = cc.get_web().get_lists().getByTitle('ProjectInformation');
var caml = new SP.CamlQuery();
caml.set_viewXml('<View><ViewFields><FieldRef Name="ProjectExecution"/>ViewFields</View>');
this.list = alllist.getItems(caml);
cc.load(list,'Include(ProjectExecution)');
cc.executeQueryAsync(Function.createDelegate(this,this.QuerySucceeded5),Function.createDelegate(this,this.onQueryFailed));
}
function QuerySucceeded5(){
var listiteminfo='';
var listItemEnumerator = list.getEnumerator();
while(listItemEnumerator.moveNext())
{
var listitem = listItemEnumerator.get_current();
listiteminfo += '\nID:'+ listitem.get_id();
alert(listiteminfo.toString());
}
alert(listiteminfo.toString());
}
function onQueryFailed(){
alert("Failed");
}
Thanks in advance..!!