Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Steve Morgan 1346 posts 4453 karma points c-trib
    Mar 11, 2015 @ 15:43
    Steve Morgan
    0

    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);

       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!

  • Sam 5 posts 25 karma points
    Sep 07, 2015 @ 21:42
    Sam
    0

    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();
    
  • Steve Morgan 1346 posts 4453 karma points c-trib
    Sep 08, 2015 @ 06:42
    Steve Morgan
    0

    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.

  • Sam 5 posts 25 karma points
    Sep 08, 2015 @ 11:23
    Sam
    0

    No problem. Strangely, if I change the line:

    rf.Values.Add("test");
    

    To:

    rf.Values[0] = "test";
    

    The problem no longer occurs. This makes me think the problem is related to record fields having multiple values.

Please Sign in or register to post replies

Write your reply to:

Draft