I try to take the elemtens in a list where the field "Mise à jour parc" is set to "No" with the boolean type.
My field 'Mise à jour parc" has for db name for sharepoint "Mise_x0020__x00e0__x0020_jour_x0"
Here is my query code with the query:
var collListItemToBeUpdatedReventeMaj = "";
var numOccurrencesMajRevente = 0;
var enumeratorRevente;
function getItemsToBeUpdatedReventeMaj() //this function called on button click to get ID's
{
collListItemToBeUpdatedReventeMaj = "";
var clientContext = new SP.ClientContext.get_current();
var oList = clientContext.get_web().get_lists().getByTitle('Matériel revente finale');
var camlQueryReventeMaj = new SP.CamlQuery();
camlQueryReventeMaj.set_viewXml("<View> <Query> <Where> <Eq> <FieldRef Name='Mise_x0020__x00e0__x0020_jour_x0'> <Value Type='Boolean'>0</Value> </FieldRef> </Eq> </Where> </Query> </View> ");
collListItemToBeUpdatedReventeMaj = oList.getItems(camlQueryReventeMaj);
clientContext.load(collListItemToBeUpdatedReventeMaj);
clientContext.executeQueryAsync(getItemsToBeUpdatedSuccess1ReventeMaj, getItemsToBeUpdatedFailed1ReventeMaj);
}
function getItemsToBeUpdatedSuccess1ReventeMaj()
{
numOccurrencesMajRevente = collListItemToBeUpdatedReventeMaj.get_count();
setValue2();
}
function getItemsToBeUpdatedFailed1ReventeMaj(sender, args)
{
alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
}
function setValue2() {
$("#revente_count").text(numOccurrencesMajRevente).toString();
}
I always go in the failed. I tried :
"<View> <Query> <Where> <Eq> <FieldRef Name='Mise_x0020__x00e0__x0020_jour_x0'> <Value Type='Boolean'>False</Value> </FieldRef> </Eq> </Where> </Query> </View> "
"<View> <Query> <Where> <Eq> <FieldRef Name='Mise_x0020__x00e0__x0020_jour_x0'> <Value Type='Integer'>0</Value> </FieldRef> </Eq> </Where> </Query> </View> "
"<View> <Query> <Where> <Eq> <FieldRef Name='Mise_x0020__x00e0__x0020_jour_x0'> <Value Type='Text'>No</Value> </FieldRef> </Eq> </Where> </Query> </View> "
"<View> <Query> <Where> <Eq> <FieldRef Name='Mise_x0020__x00e0__x0020_jour_x0'> <Value Type='Bool'>0</Value> </FieldRef> </Eq> </Where> </Query> </View> "
I'm sure FieldRef is good because without the Value, I have the number for all items.
An idea?