Imagine being paid to improve your favorite CMS!

It could be you! Umbraco HQ are hiring and are looking for both talents and senior developers. Wonderful workplace, friendly colleagues and competitive salary.

Copied to clipboard

Flag this post as spam?

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


  • JLon 268 posts 366 karma points
    Aug 10, 2017 @ 14:41
    JLon
    0

    Umbraco forms RecordService delete is returning error

    Hi All,

    Been trying to create Workflow Type and at the end of the workflow I need to remove / delete the record data / form data. The rest of the code works, but breaks when I try to add in the delete codes which I've got from the Umbraco documentation.

    I've tried

    RecordService.Instance.Delete(record, e.Form);
    

    And

    var recordService = new RecordService();
    recordService.Delete(e.Record, e.Form);
    

    And they both ended up with the below error

    "Object reference not set to an instance of an object." at Umbraco.Forms.Data.Storage.RecordFieldStorage.GetAllRecordFields(Record record, Form form)\r\n at Umbraco.Forms.Data.Storage.RecordStorage.GetRecord(Object id, Form form)\r\n at Umbraco.Forms.Core.Services.WorkflowService.ExecuteWorkflows(List`1 ...

    Any idea?

    I've even tried the below

    using (RecordStorage recordStorage = new RecordStorage())
       recordStorage.DeleteRecord(record, e.Form);
    
  • Dennis Aaen 4240 posts 17231 karma points admin hq c-trib
    Aug 15, 2017 @ 17:56
    Dennis Aaen
    0

    Hi JLon,

    I was thinking if you have been hit by this issue - http://issues.umbraco.org/issue/CON-1344 ?

    If so could you please try upgrade your Umbraco Forms by using this set of files https://umbraconightlies.blob.core.windows.net/umbraco-forms-nightlies/UmbracoForms.Files.6.0.3-alpha-20170815-001.zip. and follow this documentation https://our.umbraco.org/documentation/Add-ons/UmbracoForms/Installation/ManualUpgrade

    Please make sure to take a backup of your umbraco site and database before you are doing this so you can roll back if something unexpected happens.

    Hope this helps,

    /Dennis

Please Sign in or register to post replies

Write your reply to:

Draft