Symptoms
Forms Disappeared in K2 Designer
Diagnoses
We have noticed that there are few orphaned items in Category.Data table with Category that doesn't exist in Category.Category table.
Resolution
1. Run the following script to find orphaned CategoryData Items
SELECT CRowId]
,/CategoryId]
,/ObjectDelete]
,/Data]
,/ObjectName]
,/DataType]
FROM OK2].2Category].yData]
WHERE CategoryId NOT IN (SELECT CId] FROM OK2].2Category].yCategory])
2. Take a note of the Id of one of the missing categories from the query above. (for this example lets say the Id is 1234)
3. Create a new ?EWSApplicationForms? category where the old one was, using K2 Designer
4. Perform a select on the Category table to get the ID of the new Category (for this example it is 2345 )
SELECT CId] FROM OK2].2Category].yCategory]
WHERE RName] = 'EWSApplicationForms'
5. Use the new category record in the table as the baseline and insert a copy but with the old id:
SET IDENTITY_INSERT RK2].2Category].yCategory] ON
INSERT INTO TK2].2Category].yCategory]
(/Id]
,/Name]
,/DisplayName]
,/Description]
,/ParentCategories]
,/SystemId])
SELECT 1234
,/Name]
,/DisplayName]
,/Description]
,/ParentCategories]
,/SystemId]
FROM OK2].2Category].yCategory]
WHERE RId] = 2345
SET IDENTITY_INSERT RK2].2Category].yCategory] OFF
6. Delete the new category that was created:
DELETE FROM OK2].2Category].yCategory]
WHERE RId] = 2345