Trigger "On approve" workflows from "On submit" workflow
I have the following code in a custom WorkflowType for changing record state from Submitted to Approved.
FormStorage fs = new FormStorage();
Form f = fs.GetForm(record.Form);
RecordStorage rs = new RecordStorage();
record.State = FormState.Approved;
rs.UpdateRecord(record, f);
fs.Dispose();
rs.Dispose();
This works as expected - however it does not trigger the defined workflows for the "On approve"-event. How do I solve this problem in Umbraco Forms v4.3.3? I am able to trigger the workflows manually from the Umbraco back-end, but not from my WorkflowType-code.
Has worked fine for me, workflows are triggered correctly, however, calling .Approve() seems to not trigger anything. The status appears to get updated, but no workflows for OnApproved are called.
Did you have any luck getting around this?
I am going to write my own function to replace the workflow if I can't get this working, as a workflow is 100% necessary, more of a nicety for what I am doing, but it would be great to know .Approve does really work if I need it later..
Trigger "On approve" workflows from "On submit" workflow
I have the following code in a custom WorkflowType for changing record state from Submitted to Approved.
This works as expected - however it does not trigger the defined workflows for the "On approve"-event. How do I solve this problem in Umbraco Forms v4.3.3? I am able to trigger the workflows manually from the Umbraco back-end, but not from my WorkflowType-code.
I solved the issue. In order to change a record's state to approved AND trigger the "On approve"-workflows the RecordService must be used:
The RecordService class can be found in the namespace: "Umbraco.Forms.Web.Services"
Hi. I tried this but my "On approve" workflow is not getting executed. Anybody else getting this issue?
This is my code:
@Romeo, I have had the same issue..
Has worked fine for me, workflows are triggered correctly, however, calling .Approve() seems to not trigger anything. The status appears to get updated, but no workflows for OnApproved are called.
Did you have any luck getting around this?
I am going to write my own function to replace the workflow if I can't get this working, as a workflow is 100% necessary, more of a nicety for what I am doing, but it would be great to know .Approve does really work if I need it later..
Cheers,
Mark
is working on a reply...