I've read the Contour developer docs, but I still can't get this to work. All I'm trying to do is update 3 hidden fields on my form when its submitted (or opened, either one would work).
When I debug, I can see my values are updated in the Record object, but it isn't saving.
public override Umbraco.Forms.Core.Enums.WorkflowExecutionStatus Execute(Record record, RecordEventArgs e)
{
foreach (RecordField recordField in record.RecordFields.Values)
{
if (recordField.Field.Id == new Guid(this.ReferringToField))
I set this on the approved state and now it works. The only problem is this will need have a manual approval, so it will need to work on submitted. Any idea why it would work on one, and not the other?
Hi, i know this is an old post. but am trying to update some fields using a workflow which is triggered on the Resumed state (want it to also trigger on the PartialSubmit state but that trigger doesnt seem to be working).
I am having the similiar problem in that when the workflow is triggered the fields do not have the new data, it seems as thoguh the workflow is triggered before the actual saving of the data?
Is my understanding correct? and is this a bug? ie surely the workflow should be triggered after the save?
Hope you managed to find a solution if so let me know
Update field values in workflow
I've read the Contour developer docs, but I still can't get this to work. All I'm trying to do is update 3 hidden fields on my form when its submitted (or opened, either one would work).
When I debug, I can see my values are updated in the Record object, but it isn't saving.
public override Umbraco.Forms.Core.Enums.WorkflowExecutionStatus Execute(Record record, RecordEventArgs e)
{
foreach (RecordField recordField in record.RecordFields.Values)
{
if (recordField.Field.Id == new Guid(this.ReferringToField))
{
recordField.Values.Clear();
recordField.Values.Add(umbraco.library.RequestCookies(Constants.Cookies.ReferringToClinicInfo));
}
else if (recordField.Field.Id.ToString() == this.ReferringFromField)
{
recordField.Values.Clear();
recordField.Values.Add(umbraco.library.RequestCookies(Constants.Cookies.ReferringClinicInfo));
}
else if (recordField.Field.Id.ToString() == this.ReferringProviderField)
{
recordField.Values.Clear();
recordField.Values.Add(umbraco.library.RequestCookies(Constants.Cookies.ReferringProvider));
}
}
RecordStorage rs = new RecordStorage();
rs.UpdateRecord(record, e.Form);
rs.UpdateRecordXml(record, e.Form);
rs.Dispose();
return Umbraco.Forms.Core.Enums.WorkflowExecutionStatus.Completed;
}
Comment author was deleted
Could you try setting this on the approved state and let me know what happens there?
I set this on the approved state and now it works. The only problem is this will need have a manual approval, so it will need to work on submitted. Any idea why it would work on one, and not the other?
Comment author was deleted
Think it's because the values get overwritten if you place them before approval
Hi, i know this is an old post. but am trying to update some fields using a workflow which is triggered on the Resumed state (want it to also trigger on the PartialSubmit state but that trigger doesnt seem to be working).
I am having the similiar problem in that when the workflow is triggered the fields do not have the new data, it seems as thoguh the workflow is triggered before the actual saving of the data?
Is my understanding correct? and is this a bug? ie surely the workflow should be triggered after the save?
Hope you managed to find a solution if so let me know
Think I am having a similar problem trying to update values on RecordService.RecordPartiallySubmitted
record.RecordFields[field.Id].Values[0] = value;
recordStorage.UpdateRecord(record, form);
But upon viewing the entry in Contour the values are not saved.
Any ideas?
Is there any news on this - I'm trying to update a record in RecordService.RecordApproved += RecordService_RecordApproved;
When I view the entry in the Contour UI the value has not been saved?
Sorry wrong thread
Just as a though though. If this is for approved state. Could you:
Make the changes i approved state
Save the form and records
Change the state to partial-submitted
Save the form and records?
is working on a reply...