Copied to clipboard

Flag this post as spam?

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


  • Albin Ljunghusen 2 posts 22 karma points
    Jan 28, 2021 @ 13:34
    Albin Ljunghusen
    0

    Umbraco Forms nullRef when calling IRecordsService.Submit

    Hey!

    I'm migrating from EpiServer to Umbraco, and I'm using the IRecordsService to import our old xforms-submissions to UmbracoForms submissions.

    Three months ago it worked fine, but now I'm getting a null ref error when calling IRecordService.Submit(record, form).

    Looking at the call stack the exception is thrown in Umbraco.Forms.Core.dll!Umbraco.Forms.Core.Services.PageService.GetPageElements() But i am not able to figure out what is null that shouldn't be.

    The Record:

       {
          "Id": 0,
          "Form": "2a7f1717-895b-4df2-aa41-09437e5b0f2c",
          "Created": "2020-04-08T10:35:32.6298327",
          "Updated": "2020-04-08T10:35:32.6298327",
          "State": 4,
          "CurrentPage": "00000000-0000-0000-0000-000000000000",
          "UmbracoPageId": 0,
          "IP": "",
          "UniqueId": "c50129dc-fecc-40b7-82cf-629e85f3ae12",
          "StateAsString": "Approved",
          "RecordFields": "redacted from example"
        }
    

    The Form:

     {
        "name": "FOC",
        "created": "2018-06-15T11:06:16.823Z",
        "pages": [
          {
            "fieldSets": "redacted from example",
            "sortOrder": 0,
            "id": "00000000-0000-0000-0000-000000000000",
            "form": "00000000-0000-0000-0000-000000000000"
          }
        ],
        "id": "2a7f1717-895b-4df2-aa41-09437e5b0f2c",
        "fieldIndicationType": "MarkMandatoryFields",
        "indicator": "*",
        "showValidationSummary": false,
        "hideFieldValidation": false,
        "requiredErrorMessage": "Du måste fylla i {0}",
        "invalidErrorMessage": "Du måste fylla i ett giltigt värde för {0}",
        "messageOnSubmit": "Tack för ditt svar.",
        "goToPageOnSubmit": 0,
        "manualApproval": false,
        "storeRecordsLocally": true,
        "disableDefaultStylesheet": false,
        "useClientDependency": false,
        "workflows": [],
        "submitLabel": "Skicka",
        "nextLabel": "Nästa",
        "prevLabel": "Föregående"
      }
    

    Thankful for any help!

  • Albin Ljunghusen 2 posts 22 karma points
    Jan 28, 2021 @ 14:17
    Albin Ljunghusen
    0

    I believe this has to do with the forms now having workflows, which they didn't have last time I used this code.

    Is there a way to submit records without activating the workflows?

Please Sign in or register to post replies

Write your reply to:

Draft