The INSERT statement conflicted with the FOREIGN KEY constraint FKUFRecordDataStringUFRecordFields. The conflict occurred in database, table dbo.UFRecordFields, column 'Key'.\r\nThe statement has been terminated.
System.Data.SqlClient.SqlException (0x80131904): The INSERT statement conflicted with the FOREIGN KEY constraint "FK_UFRecordDataString_UFRecordFields".
I also receive this error too occasionally (3.0.2.1 & 7.1.1), it's completely random but it's driving us nuts as there doesn't seem to be an obvious reason for it to occur.
Using RecordService to delete record results in Exception
I thought "that will be easy", but now I'm pretty much stuck on something that looked all too easy to accomplish.
Plan: A workflow that deletes the current record.
Execution: Custom workflow class (see below)
Result: Umbraco Exception (DataLayer): SQL helper exception in ExecuteNonQuery
This is the code
Here are the details from UmbracoTraceLog.txt:
Assigned to submit state
It seems to me that this issue is reported in a similar manner here:
http://our.umbraco.org/forum/umbraco-pro/contour/37335-Contour-Workflow-delete-record-database-error
http://our.umbraco.org/forum/umbraco-pro/contour/23003-workflow-delete-record-not-working
Any help would be greatly appreciated! :)
Marc.
Comment author was deleted
Hey,
Could you try moving the workflow to the approved stage? And let me know if that works, thanks :)
Sure. Tried that but got an "Object reference not set to an instance" type of error after submitting the form.
Unfortunately I can't find details/stack trace in UmbracoTraceLog.txt for that error.
Comment author was deleted
Ok thanks, will give it a try and report back later today
Comment author was deleted
Ok fixed the problem so you can upgrade to http://nightly.umbraco.org/Umbraco%20Contour/3.0.15%20WIP/
But please place the workflow on the approved state otherwise it won't work
Upgrade instructions can be found here http://our.umbraco.org/projects/umbraco-pro/contour/documentation/Installation/Upgrade
Didn't spot the forum post last week so next time ping me sooner ;)
Wasn't too urgent, so I didn't want to be too pushy. :)
Looks good now with 3.0.15. Working as expected.
Thanks for your quick help, Tim!
Comment author was deleted
Great, thanks for confirming :)
I still have this error in contour 3.0.21
The INSERT statement conflicted with the FOREIGN KEY constraint FKUFRecordDataStringUFRecordFields. The conflict occurred in database, table dbo.UFRecordFields, column 'Key'.\r\nThe statement has been terminated.
I also have this error with contour 3.0.21 & v 7.1.6.
2014-09-15 14:29:17,513 [41] ERROR umbraco.DataLayer.SqlHelper`1[[System.Data.SqlClient.SqlParameter, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]] - [Thread 37] Error executing query INSERT INTO UFRecordDataString([key], Value) VALUES(@key, @value)
System.Data.SqlClient.SqlException (0x80131904): The INSERT statement conflicted with the FOREIGN KEY constraint "FK_UFRecordDataString_UFRecordFields".
I also receive this error too occasionally (3.0.2.1 & 7.1.1), it's completely random but it's driving us nuts as there doesn't seem to be an obvious reason for it to occur.
Any news on this one?
is working on a reply...