Issue

After changing a SharePoint List Column type from "Choice" to something different (i.e. Single Line of Text), the following errors may be encountered when attempting to edit the Workflow associated with the SharePoint List:

 

"Exception of type SourceCode.SmartObjects.Client.SmartObjectException was thrown"

Image

or

"SmartObject [Choice] could not be found"

Image

 

Attempting to deploy the workflow will display the same "SmartObject [Choice] could not be found" error and the Workflow will not be deployed. 

 

When attempting to edit a View, an "Object reference not set to an instance of an object" error is displayed.

Image

Symptoms

When a SharePoint List containing a Choice Column is Appified with SmartObjects, Forms and a Workflow, an additional SmartObject is created for K2 to retrieve the Choice Options, from the Choice Column.

When this Choice Column is changed to a different type (i.e. single line of text), it is required to regenerate the SmartObjects.

 

The Regeneration process deletes the "choice" SmartObject, as no Choice Options are available anymore. This causes reference errors in the previously created Views and Workflows.

 

Based on the K2 4.7 Fix Packs that has already been installed, the following errors will be encountered:

 

K2 4.7 prior to November 2017 Cumulative Update Fix Pack 7: 

- When attempting to edit the Workflow, an "Exception of type SourceCode.SmartObjects.Client.SmartObjectException was thrown" error is displayed.

- When attempting to edit a View, an "Object reference not set to an instance of an object" error is displayed.

 

K2 4.7 November 2017 Cumulative Update Fix Pack 7 up to Fix Pack 13

- When attempting to edit the Workflow, the Workflow will open, but an error will be displayed stating "SmartObject [Choice] could not be found."

- When attempting to edit a View, an "Object reference not set to an instance of an object" error is displayed.

Resolution

The "Object reference not set to an instance of an object" error when attempting to edit a View has been addressed in the K2 November 2017 Cumulative Update Fix Pack 14. 

After deploying the Fix Pack, the View can be edited and the Application Lifecycle Management (ALM) will flag any broken reference on the View. The View can then be edited to resolve the issue. 

To rectify the "SmartObject [Choice] could not be found" error when editing the Workflow, please log a Support Ticket with K2 Support as direct Database manipulation will be required to remove the reference from the Workflow. 

Please reference this article for faster resolution to the issue.