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");
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.
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();
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.
Hey, i had the same problem.
Thanks for your post, it solve me a lot of time.
Great stuff :-)
is working on a reply...