Is there a way to run forms workflow from a .cs file?
I was wondering if there is a way to run/execute a specific workflow from a .cs file without a form submission so that I can change the record status (approve or delete) by clicking on a link from the email.
You can approve a record, which will change the state of the record. It will then trigger any workflows you have setup for Approved.
https://gist.github.com/tomfulton/2493234
I tried that step which works great, but I want to do something on deleting the record as well.
In addition to that, I want to implement a simple process where the person doesn't have to log in to the cms to approve/delete records. So a controller with right calls to workflow execute should do the trick but not sure how to do that.
Also regarding your link, I was looking at it yesterday and I couldn't get Umbraco.Forms.Core.Services.RecordService this to work. There is NO recordservice in the services. I only get 3 (cacheservice, updateservice & workflowservice) classes
In Contour there used to be a way to say 'advanced events' in the back office and it allowed you to add workflows to the Deleted event (for example). I can's see that in Umbraco Forms.
I think you can just assign your own code to the deleted event of Umbraco.Forms.Core.Services.RecordService.
You can also use RecordService to approve/delete records if you have their id.
Is there a way to run forms workflow from a .cs file?
I was wondering if there is a way to run/execute a specific workflow from a .cs file without a form submission so that I can change the record status (approve or delete) by clicking on a link from the email.
You can approve a record, which will change the state of the record. It will then trigger any workflows you have setup for Approved. https://gist.github.com/tomfulton/2493234
Thanks for the quick response David.
I tried that step which works great, but I want to do something on deleting the record as well.
In addition to that, I want to implement a simple process where the person doesn't have to log in to the cms to approve/delete records. So a controller with right calls to workflow execute should do the trick but not sure how to do that.
Also regarding your link, I was looking at it yesterday and I couldn't get Umbraco.Forms.Core.Services.RecordService this to work. There is NO recordservice in the services. I only get 3 (cacheservice, updateservice & workflowservice) classes
In Contour there used to be a way to say 'advanced events' in the back office and it allowed you to add workflows to the Deleted event (for example). I can's see that in Umbraco Forms.
I think you can just assign your own code to the deleted event of
Umbraco.Forms.Core.Services.RecordService
.You can also use RecordService to approve/delete records if you have their id.
That is exactly what I want to do here using the RecordService, but as said in my previous comments I cannot access RecordService.
All I get within
Umbraco.Forms.Core.Services
is CacheService, UpdateService & workflowServiceI am using the latest Umbraco Forms 4.3.2
is working on a reply...