2011-08-12 138 views
1

我目前正在嘗試按「COUNTRY」列排序。但是不斷收到一個錯誤「Object Required」。我已經做了這一百萬次,但不能得到這個工作代碼是一樣的上一次,但不工作。使用Caml訂購

請幫

   <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> \ 
         <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({ 

回答

4

我從來沒有叫JS通過這個網絡服務,但我猜你需要用你的排序依據的<查詢>標籤:

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

BOOOMMM .. ..你這個男人安德烈亞斯,我試着用查詢,但是必須要做它的錯誤。謝謝 – MarkSull

+0

hehe yeah CAML查詢可能是一個痛苦的** ;-) – int32