开发者

Using Caml to order by

开发者 https://www.devze.com 2023-03-27 10:30 出处:网络
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

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

精彩评论

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