使用 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({
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我从来没有通过 JS 调用过这个 Web 服务,但我想你需要将 OrderBy 包装在中。标签:
I've never called this web-service via JS, but i guess you need to wrap your OrderBy in a <query> tag: