0
    var soapEnv =
            "<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'> \
                <soapenv:Body> \
                <GetListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'> \
                    <listName>Tasks</listName> \
                    <query><Query><Where><And><Neq><FieldRef Name='Status'/><Value Type='Choice'>Completed</Value></Neq></And><And><Neq><FieldRef Name='Status' /><Value Type='Choice'>Waiting for Inputs</Value></Neq><Neq><FieldRef Name='Status' /><Value Type='Choice'>On Hold</Value></Neq></And></Where></Query></query>\
                    <viewFields> \
                        <ViewFields> \
                            <FieldRef Name='Title' /> \
                            <FieldRef Name='Status' /> \
                             <FieldRef Name='DueDate' /> \
                        </ViewFields> \
                    </viewFields> \
                </GetListItems> \
                </soapenv:Body> \
                </soapenv:Envelope>";

    $.ajax({

        url: url + prjName + "/_vti_bin/lists.asmx",
        type: "POST",
        dataType: "xml",
        data: soapEnv,
        complete: processResult,
        contentType: "text/xml; charset=\"utf-8\""
    });

Above isMY caml query, but doesnt give me desired output.Is there any character limits in using CAML query??

1
  • What is the output? And is this SP2010 or SP2013/SPO?
    – wjervis
    Commented Nov 28, 2014 at 13:03

1 Answer 1

0

Your query is wrong. It should be

<Where>
    <And>
        <Neq>
            <FieldRef Name='Status'/><Value Type='Choice'>Completed</Value>
        </Neq>  
        <And>
            <Neq>
                <FieldRef Name='Status' /><Value Type='Choice'>Waiting for Inputs</Value>
            </Neq>
            <Neq>
                <FieldRef Name='Status' /><Value Type='Choice'>On Hold</Value>
            </Neq>
        </And>
    </And>
</Where>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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