Copied to clipboard

Flag this post as spam?

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


  • Dallas 131 posts 403 karma points
    Apr 29, 2011 @ 10:48
    Dallas
    0

    changing a field value

    I am trying to change a field value in a custom workflow but I have had trouble saving the change. I have added the workflow to the Approve event. The example in the Contour Developer Docs ( page 12 ) uses UpdateRecord() but I was not able to get the value to change until I used UpdateRecordXml()  ( which I found in this good example : http://www.nibble.be/?p=83 )

    Tim's example uses both but I have found that I only need UpdateRecordXml().

    Could someone explain the difference between these methods and when each one would apply?

      // update hidden field Confirmation Sent - success
      var emailSentRecordField = record.GetRecordField("Confirmation Sent");

     emailSentRecordField.Values.Clear();
     emailSentRecordField.Values.Add("Sent Successfully");

     Umbraco.Forms.Data.Storage.RecordStorage store = new RecordStorage();
            
     //   store.UpdateRecord(record,e.Form);
     store.UpdateRecordXml(record,e.Form);
     store.Dispose();

     

     

  • Tim 1193 posts 2655 karma points c-trib
    Apr 29, 2011 @ 14:14
    Tim
    2

    I think (although I could be wrong) that UpdateRecord() updatees the actual record in the database, whereas UpdateRecordXml updates the XML for the record that's used for most of the queries. I'm not 100% on this though, to check, try updating a field with the XML method, and see if its updated in the DB.

  • Igor 25 posts 45 karma points
    Dec 19, 2011 @ 22:40
    Igor
    0

    Hey, i had the same problem.

    Thanks for your post, it solve me a lot of time.

    Great stuff :-)

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies