Copied to clipboard

Flag this post as spam?

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


  • Rohith Racherla 9 posts 79 karma points
    Jul 18, 2016 @ 14:29
    Rohith Racherla
    0

    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.

  • David Peck 687 posts 1863 karma points c-trib
    Jul 18, 2016 @ 14:58
    David Peck
    0

    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

  • Rohith Racherla 9 posts 79 karma points
    Jul 18, 2016 @ 15:05
    Rohith Racherla
    0

    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

  • David Peck 687 posts 1863 karma points c-trib
    Jul 18, 2016 @ 21:30
    David Peck
    0

    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.

  • Rohith Racherla 9 posts 79 karma points
    Jul 19, 2016 @ 11:06
    Rohith Racherla
    0

    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 & workflowService

    I am using the latest Umbraco Forms 4.3.2

Please Sign in or register to post replies

Write your reply to:

Draft