Did a test upgrade of a site from v7.1.8 to 7.2.2 upgrading to Forms.
All seems fine except the custom workflows have an issue. I have a couple of hidden values which I update in the workflow.
It throws a SQL error on store.UpdateRecord(record, e.Form);
Umbraco.Forms.Data.Storage.RecordStorage store = new Umbraco.Forms.Data.Storage.RecordStorage();
record.RecordFields[eventNameFieldGUID].Values[0] = eventName;
record.RecordFields[EventStartDateFieldGUID].Values[0] = eventDate;
store.UpdateRecord(record, e.Form);
store.Dispose();
The exception is:
{"The INSERT statement conflicted with the FOREIGN KEY constraint \"FK_UFRecordDataString_UFRecordFields_Key\". The conflict occurred in database \"MYDATABASE-v722\", table \"dbo.UFRecordFields\", column 'Key'.\r\nThe statement has been terminated."}
Is this a known problem or just an issue with forms imported using the package?
UPDATE: Just created a brand new form and I hit the same error... so I don't think it's anything to do with the import!
Any updates on this one? Is there a workaround? I'm having the exact same issue with a very simple workflow code snippit as follows:
foreach (RecordField rf in record.RecordFields.Values)
{
var fieldValue = rf.ValuesAsString();
rf.Values.Add("test"));
}
RecordStorage rs = new RecordStorage();
rs.UpdateRecord(record, e.Form); //This line will throw the exception
rs.Dispose();
Contour Upgraded to Forms...
Hi,
Did a test upgrade of a site from v7.1.8 to 7.2.2 upgrading to Forms.
All seems fine except the custom workflows have an issue. I have a couple of hidden values which I update in the workflow.
It throws a SQL error on store.UpdateRecord(record, e.Form);
The exception is:
{"The INSERT statement conflicted with the FOREIGN KEY constraint \"FK_UFRecordDataString_UFRecordFields_Key\". The conflict occurred in database \"MYDATABASE-v722\", table \"dbo.UFRecordFields\", column 'Key'.\r\nThe statement has been terminated."}
Is this a known problem or just an issue with forms imported using the package?
UPDATE: Just created a brand new form and I hit the same error... so I don't think it's anything to do with the import!
Any updates on this one? Is there a workaround? I'm having the exact same issue with a very simple workflow code snippit as follows:
I never got the time to solve this I'm afraid Sam. Left the client on the older version instead.
I'm sure the issue will raise its head again though so if you do find the solution I'd appreciate any pointers.
No problem. Strangely, if I change the line:
To:
The problem no longer occurs. This makes me think the problem is related to record fields having multiple values.
is working on a reply...