"An item with the same key has already been added" error when opening a SharePoint K2 Application
kbt153980
PRODUCTIssue
When accessing the K2 Application on a SharePoint List or Library, a error is displayed:
"An item with the same key has already been added"
Symptoms
The issue will be encountered when renaming a SharePoint List or Library, and changing the List or Library columns at the same time.
After performing the above, the following prompts will be displayed on the K2 Application:
When performing the "Regenerate SmartObjects and regenerate Views and Forms", some content will disappear from the K2 Application.
When then performing the "Rename SmartObjects, Views and Forms" action, the error will be encountered.
Resolution
The issue is caused because the Regenerate Action creates the content in a category matching the new List/Library name. When performing the Rename Action, the original category is also renamed to the new List/Library name, causing duplicate Categories.
This can be observed in K2 Designer and the same error will be encountered:
To resolve the issue, the duplicate category will need to be deleted in K2 Designer.
This is a known issue when Renaming a SharePoint List/Library and then regenerating artifacts on a SharePoint List/Library. The issue is currently with the developers to be addressed in a future update for K2.
To avoid this issue, it is suggested to first change the List/Library columns and then regenerate the Artifacts from the K2 Application Page.
Once that is completed, rename the List/Library and then rename the artifacts from the K2 Application Page.