Symptoms
When working with forms/views in K2 designer we suddenly got an error message as outlined below after saving a view. Now we cannot access the designer due to the error.
ERROR:
An item with the same key has already been added.
More Details
at SourceCode.Hosting.Client.BaseAPI.BaseAPIConnection.RemoteCall(String TypeName, String MethodName, Objectt] Parameters, Booleann] NullList, MarshalMessageType CallType)
at SourceCode.Hosting.Client.BaseAPI.BaseAPI.RemoteCall(String TypeName, String MethodName, Objectt] Parameters, Booleann] NullList, MarshalMessageType CallType)
at SourceCode.Hosting.Client.BaseAPI.BaseAPI.RemoteSessionCall(String TypeName, String MethodName, Objectt] Parameters, Booleann] NullList)
at SourceCode.Forms.Management.FormsManager.DoSessionCall(String method, Objectt] parameters)
at SourceCode.Forms.Management.FormsManager.GetViews(Criteria criteria)
at SourceCode.Forms.AppFramework.DesignerFramework.GetRecentUserViews(String user, Int32 count)
at SourceCode.Forms.AppFramework.DesignerFramework.GetRecentUserObjects(String user, Int32 count)
at SourceCode.Forms.Default.Page_Load(Object sender, EventArgs e)
at System.Web.UI.Control.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Diagnoses
This issue seems specific to this one View. If possible try to Edit the View and go through all the rules, edit them and just click on Finish. However in this specific issue this is not possible.
Resolution
The issue was resolved by undoing the checkout on the view by running the Form.aUndoViewsCheckOut stored procedure in the SQL DB. The only drawback then of course was that all changes since last check-in were lost.
This is documented in this article: https://grok.lsu.edu/article.aspx?articleid=17469