简体   繁体   English

新提升的InfoPath字段不在表单库中吗?

[英]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: 但是,该字段未被提升,因为在以下任何情况下我都看不到该字段:

  • the Item Properties page (View/Edit) “项目属性”页面(查看/编辑)
  • the Create/Modify View page 创建/修改视图页面
  • the Columns list on the Form Library's settings page 表单库的设置页面上的列列表
  • the Columns list of the Content Type for the form, on the Form Library's settings page 表单库的“设置”页面上表单的“内容类型”的“列”列表

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: 我最终要做的最终是:

  1. Deleted the entire Form Library 删除了整个表单库
  2. Created a new copy/version of the Form Library, and added the form's Content Type to it from the Site's Content Types Gallery 创建了表单库的新副本/版本,并从网站的内容类型库向其中添加了表单的内容类型

This fixed nothing. 这没有解决任何问题。 Don't do that. 不要那样做

My next step was probably excessive, but I: 我的下一步可能太过分了,但我:

  1. Deleted the entire Form Library 删除了整个表单库
  2. Deleted the form's Content Type from the the Site's Content Types Gallery 从网站的内容类型库中删除了表单的内容类型
  3. Removed the field from the InfoPath form entirely 完全从InfoPath表单中删除了该字段
  4. Published the form (minus field) and uploaded it in Central Admin 发布表单(减号字段)并将其上传到Central Admin
  5. Re-added the field in InfoPath and published, again promoting the field the same way I had before, and uploaded it through Central Admin 在InfoPath中重新添加该字段并发布,以与以前相同的方式再次对该字段进行了推广,并通过Central Admin将其上传
  6. Tried to add the form's Content Type to a new copy/version of the Form Library (the Content Type was not available) 试图将表单的内容类型添加到表单库的新副本/版本中(该内容类型不可用)
  7. Deactivated and re-Activated the feature for the form in the Site Collection Settings 在网站集设置中停用并重新激活表单的功能
  8. Added the form's Content Type to the new Form Library 将表单的内容类型添加到新的表单库

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.

相关问题 将具有已升级字段的InfoPath表单部署到WSP中的SharePoint - Deploy an InfoPath form with promoted fields to SharePoint within a WSP 将InfoPath字段升级到WSS 3.0 - Promoted InfoPath Fields into WSS 3.0 以编程方式编辑Infopath表单字段? - Programmatically Edit Infopath Form Fields? SharePoint 2010搜索是否对上载的InfoPath表单的非升级字段中的数据建立索引 - Does SharePoint 2010 Search Index the data in the non-promoted fields of uploaded InfoPath forms 保存Infopath表单w。 在SharePoint 2010库中动态创建的字段 - Save Infopath form w. dynamicly created fields in Sharepoint 2010 Library 发布到新的网站集时,Infopath表单会丢失其某些升级字段(现有内容类型)设置 - Infopath form loses some of its promoted field (existing content type) settings when published to a new site collection 在表单库中编辑重复表INfoPath Form? - Editing repeating table INfoPath Form in form library? 如何用信息路径库中的已提交覆盖已保存的表单 - How to Overwrite the Saved form with Submitted in infopath library 提交Infopath表单后,如何立即将Sharepoint Farm图书馆文档ID检索到infopath表单? - How to retrieve the Sharepoint Farm Library Document ID to the infopath form immediately after the Infopath form submission? 在带有日期的SharePoint表单库中以编程方式创建Infopath表单 - Programmatically create Infopath form in SharePoint form library with dates
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM