使用 Caml 进行排序

发布于 2024-11-29 00:56:32 字数 1538 浏览 1 评论 0原文

我目前正在尝试按“国家/地区”列进行排序。但是,不断收到错误“需要对象”。我已经这样做了一百万次,但无法让它工作,代码与上次相同,但不起作用。

请帮忙

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

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

羁拥 2024-12-06 00:56:32

我从来没有通过 JS 调用过这个 Web 服务,但我想你需要将 OrderBy 包装在中。标签:

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

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> \
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文