2011-10-25 48 views
2

我是新来的Sharepoint 2010,我目前正在尝试创建查找字段,将其添加到内容类型并通过Visual Studio 2010 SharePoint项目添加到列表中。但我遇到一些奇怪的问题。Sharepoint 2010查询字段ID格式

我已经按以下方式定义的查找字段:

<Field ID="{2A5567B7-1175-4E26-A4ED-382E4744D17A}" Type="Lookup" Name="SomeLookupField" List="Lists/SomeList" ShowField="ItemName" DisplayName="Some Field" Group="Custom Group" ReadOnly="TRUE" /> 

然后,我添加它经由FieldRef元件的ContentType。最后,列表定义在Schema.xml中包含相同的元素

它工作正常,直到我试图将我的网站保存为模板。的Sharepoint未能导出的网站,并显示错误:

Microsoft.SharePoint.SPException: Error exporting the site field named "SomeLookupField". at Microsoft.SharePoint.SPSolutionExporter.ExportFields(SPFieldCollection fields, String partitionName)

这是由错误造成的:

SPSolutionExporter: System.FormatException: Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx). at System.Guid..ctor(String g) at Microsoft.SharePoint.SPSolutionExporter.GetFieldSchemaXml(SPField field, SPWeb web, Boolean isFieldFromWeb, Boolean removeSealedAttribute) at Microsoft.SharePoint.SPSolutionExporter.ExportField(SPField field, SPWeb web)

打我周围发现了查阅字段ID不应该包含大括号,并像下面这样:

<Field ID="2A5567B7-1175-4E26-A4ED-382E4744D17A" 

我改变它后,出口开始工作正常。但是,从Visual Studio重新部署正在打破,因为它不删除字段,同时删除旧功能上却失败更新的功能激活与错误:

Error occurred in deployment step 'Activate Features': The field with Id {2A5567B7-1175-4E26-A4ED-382E4744D17A} defined in feature {235313d2-4091-4655-8b35-70b3ad31b9f4} was found in the current site collection or in a subsite.

我不知道什么可以不对我查阅字段定义?什么是定义查找字段的有效格式?

回答

2

找到了解决方案。查找列定义必须将覆盖属性设置为“TRUE”。博客关于它here

+0

谢谢,面对完全相同的问题,你是一个省时:) – Kai

相关问题