在生产部署中,我们有一个计算字段,它由引用其他两个隐藏字段的公式组成。这是简单的串联,带有一些用于确定版本的逻辑
=CONCATENATE(IF(_MajorVersion="","0",_MajorVersion),".",IF(_MinorVersion="","0",_MinorVersion))
用户无意中修改了列表的数据表视图中的公式,现在公式已损坏,如下所示
=CONCATENATE(IF(#NAME="","0",#NAME),".",IF(#NAME="","0",#NAME))
如果将此公式替换为损坏前的版本,它将不会保存,并给出以下错误
该公式引用了不存在的列。检查公式是否存在拼写错误或将不存在的列更改为现有列。在 Microsoft.SharePoint.Library.SPRequestInternalClass.UpdateField(字符串 bstrUrl、字符串 bstrListName、字符串 bstrXML)
在 Microsoft.SharePoint.Library.SPRequest.UpdateField(String bstrUrl, String bstrListName, String bstrXML)
列 _MajorVersion 和 _MinorVersion 确实存在,但被隐藏并定义如下:
我知道可以部署一项功能,使这些列可见,解决问题,然后重新隐藏它们。然而,要实现这一目标需要有大量的繁文缛节。有人知道在不部署代码的情况下执行此操作的方法吗?我也考虑过重新创建列表,但此列表中有数千个 SPListItem。
任何建议将不胜感激!
In a production deployment we have a calculated field which is composed of a formula that references two other hidden fields. This is simple concatenation with a little logic for determining version
=CONCATENATE(IF(_MajorVersion="","0",_MajorVersion),".",IF(_MinorVersion="","0",_MinorVersion))
A user inadvertently modified the formula in the datasheet view of the list and now the formula has become corrupted as shown below
=CONCATENATE(IF(#NAME="","0",#NAME),".",IF(#NAME="","0",#NAME))
If you replace this formula with the pre-corrupted version, it will not save, and gives the following error
The formula refers to a column that does not exist. Check the formula for spelling mistakes or change the non-existing column to an existing column. at Microsoft.SharePoint.Library.SPRequestInternalClass.UpdateField(String bstrUrl, String bstrListName, String bstrXML)
at Microsoft.SharePoint.Library.SPRequest.UpdateField(String bstrUrl, String bstrListName, String bstrXML)
The columns _MajorVersion and _MinorVersion do exist, but are hidden and defined as follows:
<Field SourceID="http://schemas.microsoft.com/sharepoint/3.0"
ID="{GUID}"
Name="_MajorVersion"
StaticName="_MajorVersion"
DisplayName="_MajorVersion"
Group="ApplicationStuff"
Type="Number"
Required="FALSE"
ReadOnly="FALSE"
Sealed="FALSE"
Hidden="TRUE"
ShowInListSettings="FALSE"
ShowInEditForm="FALSE"
ShowInDisplayForm="FALSE"
ShowInNewForm="FALSE" />
I know it is possible to deploy a feature which will make these columns visible, fix the problem, and then re-hide them. However, there is a lot of red-tape to make that happen. Anyone know of a way to do this without deploying code? I also considered re-creating the list, but there are thousands of SPListItems in this list.
Any suggestions would be appreciated!
发布评论
评论(1)
取消隐藏字段(使用某种实用程序,编写起来非常简单),保存公式并隐藏回来。但我认为您应该以其他方式填充计算字段,例如 SPD 工作流程或事件接收器。
Unhide the fields (using some kind of utility, very simple to write), save the formula and hide back. But I think you should probably fill the calculated field in some other fashion, such as SPD workflow or event receiver.