【问题标题】:Sharepoint Updating MMS DocumentSet fieldSharepoint 更新 MMS 文档集字段
【发布时间】:2016-05-09 13:42:42
【问题描述】:

我正在为我的公司产品编写一些 SharePoint 2013 集成,以上传包含元数据的文档集,然后上传一些文档。 除了更新需要 MMS(托管元数据服务)字段的文档集元数据字段之外,我的所有这些功能都正常工作。

dim docSetUrl as string = "http://someurl/"
Dim folder = Context.Web.GetFolderByServerRelativeUrl(docSetUrl)
Context.Load(folder)
Context.ExecuteQuery()
folder.Properties.Item("GeoObject") = "test" 'Normal string content (updates correctly)
folder.Properties.Item("Applicant") = "1353;#: Value A : REC-95342|9074b95b-9dcd-4c93-b548-32a5c7e7e083" 'Does not update correctly
folder.Update()
Context.ExecuteQuery()

现在你可以从代码中看到,我可以更新GeoObject,它只需要一个字符串值,但对于彩信类型的申请人对象,它不会改变(没有错误)。

如果我登录 SharePoint 并手动使用 MMS 选择一个项目,然后以编程方式检查它的值是:353;#: Value A:REC-95342|9074b95b-9dcd-4c93-b548-32a5c7e7e083,如果我手动清除该值,然后尝试将找到的值推回,我仍然没有结果。

我应该如何更新彩信字段?

谢谢,

【问题讨论】:

    标签: asp.net vb.net sharepoint sharepoint-2013


    【解决方案1】:

    我能够通过来自不同来源的大量输入将其拼凑​​起来。如https://unnieayilliath.com/2015/08/24/sharepoint-2013-updateclear-taxonomy-field-value-using-c-csom/

    Dim value As TaxonomyFieldValue = New TaxonomyFieldValue()
                    value.WssId = -1
                    value.TermGuid = terms.First.Id.ToString
                    value.Label = terms.First.Name
    
                    Dim list As List = folder.ListItemAllFields.ParentList
                    Dim field As Field = list.Fields.GetByInternalNameOrTitle("Property")
    
                    Dim txField As TaxonomyField = Context.CastTo(Of TaxonomyField)(field)
    
                    txField.SetFieldValueByValue(folder.ListItemAllFields, value)
                    folder.ListItemAllFields.Update()
                    Context.Load(folder.ListItemAllFields)
                    Context.ExecuteQuery()
    

    【讨论】:

      猜你喜欢
      • 2011-02-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-05-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多