The formula refers to a column that does not exist

Nov 24, 2008 at 11:01 AM
Hi,

I know this error is due to the underlying Content Deployment API rather than your excellent tool, but I was wondering if you knew of a workaround or a way of solving this problem when running an import (The same error occurs if you use the STSADM import command)


[24/11/2008 10:40:28]: FatalError: 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.SPRequest.CallCalcEngine(Int32 operation, String bstrUrl, String bstrListName, String bstrString1, String bstrString2)
   at Microsoft.SharePoint.SPFieldCalculated.CheckFormulaForTemplate(SPWeb web, XmlDocument xd, XmlElement xroot)
   at Microsoft.SharePoint.SPFieldCollection.AddFieldToWeb(String strXml, Boolean checkDisplayName)
   at Microsoft.SharePoint.SPFieldCollection.AddFieldAsXmlInternal(String schemaXml, Boolean addToDefaultView, SPAddFieldOptions op)
   at Microsoft.SharePoint.Deployment.FieldTemplateSerializer.CreateField(SPWeb web, SerializationInfoHelper infoHelper)
   at Microsoft.SharePoint.Deployment.FieldTemplateSerializer.SetObjectData(Object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector)
   at Microsoft.SharePoint.Deployment.XmlFormatter.ParseObject(Type objectType, Boolean isChildObject)
   at Microsoft.SharePoint.Deployment.XmlFormatter.DeserializeObject(Type objectType, Boolean isChildObject, DeploymentObject envelope)
   at Microsoft.SharePoint.Deployment.XmlFormatter.Deserialize(Stream serializationStream)
   at Microsoft.SharePoint.Deployment.ObjectSerializer.Deserialize(Stream serializationStream)
   at Microsoft.SharePoint.Deployment.ImportObjectManager.ProcessObject(XmlReader xmlReader)
   at Microsoft.SharePoint.Deployment.SPImport.DeserializeObjects()
   at Microsoft.SharePoint.Deployment.SPImport.Run()

Cheers
May 14, 2009 at 4:29 PM

Hi Chris,

I'd like to first say, great tool. I'm getting the same error as the user above during the import process. Although my error is in the AddField function. Here's the complete error message:

[5/14/2009 11:03:57 AM]: FatalError: 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.SPRequest.AddField(String bstrUrl, String bstrListName, String bstrSchemaXml, Int32 grfAdd)
   at Microsoft.SharePoint.SPFieldCollection.AddFieldAsXmlInternal(String schemaXml, Boolean addToDefaultView, SPAddFieldOptions op)
   at Microsoft.SharePoint.Deployment.ListSerializer.CreateOrUpdateField(SPList list, String fieldName, XmlNode fieldNode)
   at Microsoft.SharePoint.Deployment.ListSerializer.UpdateListFields(SPList list, Dictionary`2 listMetaData)
   at Microsoft.SharePoint.Deployment.ListSerializer.SetObjectData(Object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector)
   at Microsoft.SharePoint.Deployment.XmlFormatter.ParseObject(Type objectType, Boolean isChildObject)
   at Microsoft.SharePoint.Deployment.XmlFormatter.DeserializeObject(Type objectType, Boolean isChildObject, DeploymentObject envelope)
   at Microsoft.SharePoint.Deployment.XmlFormatter.Deserialize(Stream serializationStream)
   at Microsoft.SharePoint.Deployment.ObjectSerializer.Deserialize(Stream serializationStream)
   at Microsoft.SharePoint.Deployment.ImportObjectManager.ProcessObject(XmlReader xmlReader)
   at Microsoft.SharePoint.Deployment.SPImport.DeserializeObjects()
   at Microsoft.SharePoint.Deployment.SPImport.Run()

I'm assuming that the field it's choking on is a calculated field (Current Projected Value) with a formula defined as :

=[Revenue Opportunity]*Probability*[Team Award %]

Are fields added in alpha order? Any help would be very much appreciated.

Chris

May 18, 2009 at 10:40 PM

Chris,

I think you're probably right with your assessment. I'm surprised this error happens in the first place, because presumably you'd run into it if you did regular Content Deployment too. 

I've done some thinking, and unfortunately this is the only thing I can come up with - my suggestion would be to:

  • Remove calculated column from list in source environment
  • Deploy list using Wizard
  • Add calculated column back in souce environment
  • Deploy list again using Wizard

This might work since the columns used in the formula would all be already present from the first pass.

HTH,

Chris.

 

Aug 12, 2009 at 1:19 PM

Hi,

I obtain the same message "The formula refers to a column that does not exist" working with the" AddFieldAsXml" method.

I was using the "InternalName" of the field instead of using its "Name".

Sample : I was using "PublishedDate" instead of "Published".

Good definition :

<Field Type="Calculated" DisplayName="Month Published" Format="DateOnly" ResultType="Text" ReadOnly="TRUE" StaticName="Month_x0020_Published" Name="Month_x0020_Published" Required="FALSE"><Formula>=TEXT(Published,"mmm yy")</Formula><Default /><FieldRefs><FieldRef Name="Published" /></FieldRefs></Field>

Regards,

Fred Dobon