This article was created in response to a support issue logged with K2. The content may include typographical errors and may be revised at any time without notice This article is not considered official documentation for K2 software and is provided “as is” with no warranties.

Issue

This behavior can show when packaging or deploying, but both will tie back to a field in SharePoint that can not be found. You will see errors on a SharePoint 2013 Service Object not being able to find a field in SharePoint  - such as "The referenced SharePoint field cannot be found". 

Image

Symptoms

  • You might have used an old template for a SharePoint list/library to create this on the target environment. Some other changes to this list/library on the source environment might have happened since the creation of that template.
  • You would have created SharePoint workflows or currently have SharePoint workflows on the list/library involved in this deployment.
  • Usually the name of the property causing the conflict is tied to an existing SharePoint workflow on a list or library that is being packaged. The property will be formatted as follows:

    SharePoint Workflow Name: Rename Document

    Property Name: Rename Document (RenameDo0)

  • You will see the following errors in the MMC tool when Packaging and Deploying.

Packaging:

Image

Deploying:

Image

Image

Resolution

This behavior is due to the fact that there are Hidden SharePoint columns on the list/library which K2 builds the service object off of. These hidden columns are created to hold the status of a SharePoint workflow created on the list/library. These specific columns most likely do not exist on your source or target SharePoint list/library leading to a conflict in P&D. It is required for the Source and Target list/libraries to be the same for P&D to avoid these conflicts. You can see these columns by going onto your list/library and editing a view. This will show any hidden columns as well as visible custom columns that you created. 

Image

Image

If you currently do not see the property mentioned in the P&D error on the list/library, double check that you are not prompted to regenerate SmartObjects when opening the artifact page in K2 App on the relevant list/library. The source of the issue is most likely that the Service Object and SmartObject are out of sync from the actual columns on your list/library.

Otherwise, if the column does exist please ensure that your source and target list/libraries for P&D are exactly the same in structure, in this case it includes any SharePoint workflows. If the workflow is not being used at all, removing the workflow should then remove this hidden column. Be sure to Regenerate the SmartObjects for this list/library after doing this and then Package and Deploy once more.

K2 recommends the use of Site/List Templates to ensure that the P&D process is as smooth as possible and that issues such as these are avoided when going through this process. Please refer to either the 4.6.11 or 4.7 and above PDFs depending on your version at the below link:  http://help.k2.com/kb001705

There were certain circumstances where the columns were not deleted after the workflow was removed from this list. If this is the case you will need to most likely update the allow deletion property on your List/Library via Powershell or another tool such as Microsoft's SharePoint Designer, or the third party SharePoint Manager tool. See the below links for reference:

https://www.habaneroconsulting.com/stories/insights/2015/removing-custom-workflow-columns

https://docs.microsoft.com/en-us/dotnet/api/microsoft.sharepoint.spfield

Otherwise, it is suggested that you reach out to Microsoft Support as these fields should be removed when the workflow is deleted from SharePoint.