无法更新托管元数据字段

无法更新托管元数据字段

本文介绍了REST API - 无法更新托管元数据字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 

我有一个工作流程,我正在尝试更新托管元数据列,但是,更新通过204响应,但是该字段没有更新。我使用其余的api"moveto"功能将文档移动到另一个库,这可以
罚款。然后我用剩下的api"checkout"功能并检查文件。这有效。我可以更新所有其他属性,但不能更新元数据。但是,如果我只是通过UI将文件拖入库中,则不会检入该文件。然后
如果我在Postman中运行相同的命令,则会更新托管元数据列。 

I have a workflow and I am trying to update a managed metadata column, however, the update goes through with a 204 response, but the field is not updated. I use the rest api "moveto" function to move the document to another library and this works fine. Then I use the rest api "checkout" function and check the document out. This works. I can update all the other properties but not the meta data. However, if I just drag a file into the library through the UI, the file is not checked in. Then if I run the same command in Postman it updates the managed metadata column. 

{
	"__metadata": {



            "type": "SP.Data.ComplianceItem"
        },
        "ContentTypeId": "0x0101000FAE84AD1C6A7D41A0A26667078620510053816378F7F9624EA0233C9A48817A6B",
        "Title": "new title 4",
        "HR_x0020_Document_x0020_Type": {
            "__metadata": {
                "type": "SP.Taxonomy.TaxonomyFieldValue"
            },
            "Label": "Bullying & Harassment Policy - 5.2",
            "TermGuid": "827207b3-648c-42b8-b3f9-8739ada3c033",
            "WssId": 11
        },
        "Employee_x0020_Id": "2345",
        "FirstName": "asdfg",
        "Surname": "sdfg"
}

请求如上所示。 

The request is as shown above. 

我们非常感谢任何帮助。 

Any help would be really appreciated. 

祝你好运, 

Best regards, 

        Seamus 

       Seamus 

推荐答案

这是我测试的JSOM脚本(我使用REST api进行测试,结果与您在本地SharePoint 2013服务器场中共享的结果相同)。

<script type="text/javascript" src="https://code.jquery.com/jquery-1.12.4.js"></script>
    <script type="text/javascript">
        function SetManagedMetaDataField(listName,
            itemID,
            fieldName,
            term) {
            var scriptbase = _spPageContextInfo.webServerRelativeUrl + "_layouts/15/";


最好的问候,

Lee


这篇关于REST API - 无法更新托管元数据字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-19 20:49