Sharepoint 2010 REST列表服务缺少人员字段?

时间:2017-08-17 08:19:59

标签: rest sharepoint sharepoint-2010

使用listdata.svc:

通过REST服务端点访问Sharepoint 2010列表时

... / _ vti_bin / listdata.svc / ExpenseBudgetSubmissionRequests

响应缺少列表中定义的人员/用户字段:

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<feed xml:base=".../_vti_bin/listdata.svc/" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://www.w3.org/2005/Atom">
  <title type="text">ExpenseBudgetSubmissionRequests</title>
  <id>.../_vti_bin/listdata.svc/ExpenseBudgetSubmissionRequests/</id>
  <updated>2017-08-17T08:03:15Z</updated>
  <link rel="self" title="ExpenseBudgetSubmissionRequests" href="ExpenseBudgetSubmissionRequests" />
  <entry m:etag="W/&quot;1&quot;">
    <id>.../_vti_bin/listdata.svc/ExpenseBudgetSubmissionRequests(1)</id>
    <title type="text">Department1</title>
    <updated>2017-08-16T11:20:29+01:00</updated>
    <author>
      <name />
    </author>
    <link rel="edit" title="ExpenseBudgetSubmissionRequestsItem" href="ExpenseBudgetSubmissionRequests(1)" />
    <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Status" type="application/atom+xml;type=entry" title="Status" href="ExpenseBudgetSubmissionRequests(1)/Status" />
    <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/CreatedBy" type="application/atom+xml;type=entry" title="CreatedBy" href="ExpenseBudgetSubmissionRequests(1)/CreatedBy" />
    <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/ModifiedBy" type="application/atom+xml;type=entry" title="ModifiedBy" href="ExpenseBudgetSubmissionRequests(1)/ModifiedBy" />
    <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Attachments" type="application/atom+xml;type=feed" title="Attachments" href="ExpenseBudgetSubmissionRequests(1)/Attachments" />
    <category term="Microsoft.SharePoint.DataService.ExpenseBudgetSubmissionRequestsItem" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
    <content type="application/xml">
      <m:properties>
        <d:ContentTypeID>0x0100F434AF171BE4B04F8C760EB990D765EF</d:ContentTypeID>
        <d:Department>Department1</d:Department>
        <d:CostCentre>CostCentre1</d:CostCentre>
        <d:FinancialYear m:type="Edm.Double">2017</d:FinancialYear>
        <d:StatusValue>Unsubmitted</d:StatusValue>
        <d:Id m:type="Edm.Int32">1</d:Id>
        <d:ContentType>Item</d:ContentType>
        <d:Modified m:type="Edm.DateTime">2017-08-16T11:20:29</d:Modified>
        <d:Created m:type="Edm.DateTime">2017-08-16T11:20:29</d:Created>
        <d:CreatedById m:type="Edm.Int32">2</d:CreatedById>
        <d:ModifiedById m:type="Edm.Int32">2</d:ModifiedById>
        <d:Owshiddenversion m:type="Edm.Int32">1</d:Owshiddenversion>
        <d:Version>1.0</d:Version>
        <d:Path>.../Lists/Expense Budget Submission Requests</d:Path>
      </m:properties>
    </content>
  </entry>
</feed>

尝试通过$ select和$ exapnd参数指定人员字段,但没有成功。你如何访问人员字段?

1 个答案:

答案 0 :(得分:0)

相信此博客条目: https://thesharepointdive.wordpress.com/2014/09/17/user-field-does-not-appear-sharepoint-2010-rest-services/

Schema.xml中缺少List属性,但是如果没有正确的访问权限,我似乎无法直接编辑Schema xml文件。

解决方案:在列表设置中,设置人员字段以从用户组中进行选择。您可以随后将其设置回所有用户,但此操作会针对列表schema.xml中的字段创建List属性。

用户字段现在存在于REST响应中。

Click here for list settings screen shot