开发者

Using Caml to order by

Im currently trying to order by the column "COUNTRY". However keep getting an error "Object Required". Ive done this a million times but cant get this to work code is the same as last time but not working.

Please help

              <script type="text/javascript">

               $(document).ready(function() {
              var soapEnv =
        "<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'> \
        <soapenv:Body> \
                 <GetListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'> \
                    <listName>db_IMPS_Transaction_Data</listName> \
                    <OrderBy>  
                     <FieldRef Name='COUNTRY' Ascending='False' />
                    </OrderBy>
                        <viewFields> \
     开发者_JS百科                  <ViewFields> \
                        <FieldRef Name='Title'/> \
                       <FieldRef Name='COUNTRY' /> \
                       <FieldRef Name='PMTAMT' /> \
        <FieldRef Name='ITEMS' /> \
        <FieldRef Name='CUSTOMER' /> \
        <FieldRef Name='BRANCH' /> \
        <FieldRef Name='CCY' /> \
        <FieldRef Name='CD' /> \
             <FieldRef Name='A' /> \
        <FieldRef Name='ACH' /> \
        <FieldRef Name='B' /> \
                    </ViewFields> \
                         </viewFields> \
                      </GetListItems> \
                      </soapenv:Body> \
                 </soapenv:Envelope>";

                   $.ajax({


I've never called this web-service via JS, but i guess you need to wrap your OrderBy in a <query> tag:

<query> \
    <Query> \
        <OrderBy>  \
            <FieldRef Name='COUNTRY' Ascending='False' />  \
        </OrderBy>  \
    </Query> \
</query> \
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜