[英]Newly Promoted InfoPath fields not in Form Library?
I have an InfoPath form set as the primary content type on a Form Library which is working fine. 我将InfoPath表单设置为工作正常的表单库上的主要内容类型。 The form is a Managed Template uploaded/activated through Central Admin, and contains a number of Promoted Fields.
该表单是通过管理中心上载/激活的托管模板,并且包含许多“推荐字段”。
Now I've added another field to the form in InfoPath (and added a control on the form for it, for visibility) and set that field to be promoted into the library (confirmed through both Tools -> Form Options -> Property Promotion
, and the list when publishing) and published & uploaded the form (using Central Admin). 现在,我在InfoPath中向表单添加了另一个字段(并在表单上添加了控件,以提高可见性),并将该字段设置为要提升到库中(通过“
Tools -> Form Options -> Property Promotion
,以及发布时的列表),以及发布和上传表单(使用Central Admin)。
When I open the form in SharePoint (by creating a new item in the form library, or opening an existing item in that library) I see the control for my new field, and can store data in the field. 当我在SharePoint中打开表单时(通过在表单库中创建新项目,或在该库中打开现有项目),我看到了新字段的控件,并且可以在该字段中存储数据。 However, the field is NOT promoted, in that I cannot see it in any of the following:
但是,该字段未被提升,因为在以下任何情况下我都看不到该字段:
I've tried everything I can think of to get this field promoted short of deleting the entire library and starting over. 我尽了所有我能想到的一切,以使该字段得到提升,而不是删除整个库并重新开始。 Has anyone else run into this problem?
还有其他人遇到这个问题吗? How can I promote a new field into an existing library?
如何将新字段提升为现有图书馆?
Just deactivating, and then reactivating the feature was enough for me. 只需停用然后重新激活该功能就足够了。 It also didn't appear to be destructive.
它也似乎没有破坏性。 It would perhaps depend on what is in your feature, in my case the InfoPath form and nothing else.
这可能取决于您功能的内容,在我的情况下,取决于InfoPath表单,仅此而已。
Well, I've sort of answered my own question... 好吧,我已经回答了我自己的问题...
What I ended up doing was eventually: 我最终要做的最终是:
This fixed nothing. 这没有解决任何问题。 Don't do that.
不要那样做
My next step was probably excessive, but I: 我的下一步可能太过分了,但我:
And THAT worked! 而且有效!
My theory is that Deactivating and re-Activating the Feature for the InfoPath form will force the promoted fields to be updated, and that until you've done that the Content Type will still be using the old fields (so that nothing you do at the Form Library level will mean a thing). 我的理论是,停用和重新激活InfoPath表单的功能将强制更新升级的字段,并且在完成该操作之前,“内容类型”仍将使用旧的字段(因此您在表单库级别将意味着问题。 But that would still be a very destructive operation if you're working on production data, and I'm hoping there's still an easier and "safer" way of updating the Promoted Properties/Fields/Columns of an InfoPath form published to SharePoint.
但是,如果您要处理生产数据,那将仍然是非常具有破坏性的操作,我希望还有一种更轻松,更“安全”的方式来更新发布到SharePoint的InfoPath表单的“ Promoted Properties / Fields / Columns”。
But there probably isn't. 但是可能没有。
I have resolved (used workaround) this problem by PowerShell. 我已经通过PowerShell解决(使用了解决方法)此问题。
You need to know: 你得知道:
1) Field ID in Content Type 1)内容类型中的字段ID
2) XPath to field in InfoPath form 2)XPath到InfoPath表单中的字段
Next You have to use this PowerShell script: 接下来,您必须使用以下PowerShell脚本:
Add-PSSnapin Microsoft.SharePoint.PowerShell -erroraction SilentlyContinue
$web = Get-SPWeb "https://intranet.company.com"
$contentTypeName = "Content Type Name"
$ct = $web.ContentTypes[$contentTypeName]
# Content Type Fields
# Field
$fieldId = "1209bb86-645b-4e56-aea2-265a325a98af"
$fieldLinks = $ct.FieldLinks | Where-Object {$_.Id -eq $fieldId}
$fieldLinks.ReadOnly = $true
$fieldLinks.XPath = "/my:Fields/my:FieldGroup/my:Field"
$ct.Update($true)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.