Copied to clipboard

Flag this post as spam?

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


  • Bo Jacobsen 605 posts 2403 karma points
    Oct 11, 2017 @ 10:47
    Bo Jacobsen
    0

    Form record field is shown empty but it is not

    Using Forms 4.4.0 and Umbraco 7.5.11

    When i get a callback, i update some fields in a single record like this.

    record.GetRecordField(new Guid("xxx-xxx")).Values.Clear();
    record.GetRecordField(new Guid("xxx-xxx")).Values.Add("Test value");
    var rs = Recordstorage;
    var updatedRecord = rs.UpdateRecord(record, record.GetForm());
    rs.Dispose();
    

    But the record fields is shown as empty in the Forms entries. But if i take the value out it is not empty and the value is the correct one.

    var value = record.GetRecordField(new Guid("xxx-xxx")).ValueAsString();
    // value is now "Test value"
    

    Anyone has any clue why?

  • Bo Jacobsen 605 posts 2403 karma points
    Oct 25, 2017 @ 17:46
    Bo Jacobsen
    100

    Apparantly you have to do it this way in order to get it to work.

    record.GetRecordField(new Guid("xxx-xxx")).Values.Clear();
    record.GetRecordField(new Guid("xxx-xxx")).Values.Add("Test value");
    var rs = Recordstorage;
    record.RecordData = record.GenerateRecordDataAsJson();
    var updatedRecord = rs.UpdateRecord(record, record.GetForm());
    rs.Dispose();
    
Please Sign in or register to post replies

Write your reply to:

Draft