确定 SharePoint 2013 列表中列的字段 ID

gre*_*per 1 sharepoint sharepoint-2013

我正在尝试使用 SPServices UpdateList 操作,并且我需要我想要从默认只读设置更改的列的字段 ID。您如何确定字段标记设置?

//Make the author field editable
var author = "<Fields><Method ID='1'><Field /*What stuff goes here?*/ ReadOnly='FALSE' /></Method></Fields>";
$().SPServices({
    operation: "UpdateList",
    listName: "Requests",
    listProperties:"",
    updateFields: author,
    newFields: "",
    deleteFields: "",
    listVersion: "",
    async: false,
    completefunc: function (xData, Status){  
    }
});
Run Code Online (Sandbox Code Playgroud)

gre*_*per 5

我通过这样做找到了要在字段标记中放入的内容:

  1. 获取列表GUID
  2. 导航到此自定义 URL:http:// [yoursharepointsite] /_vti_bin/owssvr.dll?Cmd=ExportList&List= [yourGUID]
  3. 使用 control-F 搜索您的列名,您将拥有带有所有默认参数的字段标记!

所以对于上面的问题,标签是:

<Field ID="{1lc5j379-ec7e-42a8-901d-j85a3881c0b8}" ColName="tp_Author" RowOrdinal="0" ReadOnly="FALSE" Type="User" List="UserInfo" Name="Author" DisplayName="Created By" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="Author" FromBaseType="TRUE" Version="7" />
Run Code Online (Sandbox Code Playgroud)