Skip to main content

Am getting below error message while deploying K2 Package to a particular list.

 

"Violation of UNIQUE KEY constraint 'UQ__#A343734__0098C95D899FAD80'. Cannot insert duplicate key in object 'dbo.@Contexts'. The duplicate key value is (F, d3e5c2*personal details removed*a36-bb8b-381c7e1dca39, Newtest_collab_nafta_fcagroup_com___sites___belvidere_Lists_CompanyItemForm, <NULL>, <NULL>).

The data for table-valued parameter "@Contexts" doesn't conform to the table type of the parameter. SQL Server error is: 3602, state: 30 The statement has been terminated. System.Data.SqlClient.SqlException (0x80131904): Violation of UNIQUE KEY constraint 'UQ__#A343734__0098C95D899FAD80'. Cannot insert duplicate key in object 'dbo.@Contexts'. The duplicate key value is (F, d3e5c2*personal details removed*a36-bb8b-381c7e1dca39, Newtest_collab_nafta_fcagroup_com___sites___belvidere_Lists_CompanyItemForm, <NULL>, <NULL>).

 

The data for table-valued parameter "@Contexts" doesn't conform to the table type of the parameter. SQL Server error is: 3602, state: 30


The statement has been terminated."

 

Thanks in advance.

Gokulnath

Sound like an issue for support. As I read the error, there's a stored proc in SQL, one of its parameters is a Table Value, which means it's expecting a table of values.   K2 tries to populate that list of values but it's trying to add the same value twice, which fails, the table value parameter fails and so the stored proc fails.

 

I'm not sure what @Context refers to, that would be helpful.

 

K2 will put duplicate keys into things when it somehow gets two references to the same object. For instance I had a form with a list and a click rule on that list. I then turned on grid editing, which kept my click rule and added another click rule which I could only see when I deleted my click rule.

 

So I'd say you have two forms that reference the same thing in an unusual way. Try packaging just the one form and see if that works. If that works add additional forms until it breaks. Then you have an idea of where the duplicate is.


K2A,

 

When you use the Package and Deploy tool are you telling the tool to use an existing Smartobject? It could be trying to duplicate the smartobject and since the GUID is the same you are getting an error stating it cannot create it twice. 

 

Thanks,

Bryan Peters


Reply