Copied to clipboard

Flag this post as spam?

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


  • Dave Woestenborghs 3504 posts 12135 karma points MVP 9x admin c-trib
    Jan 10, 2013 @ 10:11
    Dave Woestenborghs
    0

    Go back to form when workflow fails

    Hi,

    I created a custom workflow (on submit) which checks some data against a webservice. When one of the check fails I should go back to the form with the entered data persisted ?

    How can I achieve this.

    Dave

  • Comment author was deleted

    Jan 10, 2013 @ 10:13

    Workflows can't stop form submission you could hook into the form validation there is an event available or another option is to use the validate method in the code first approach http://www.nibble.be/?p=205

  • Comment author was deleted

    Jan 10, 2013 @ 10:17

    Event can be found on Umbraco.Forms.Mvc.FormRenderController

    Something else that might work but is more of a hack is to place the form edit mode and then redirect to the form with the record guid when check fails... but makes more sense to do it on validaton since you'll want to provide some error details to your user 

  • Dave Woestenborghs 3504 posts 12135 karma points MVP 9x admin c-trib
    Jan 10, 2013 @ 10:27
    Dave Woestenborghs
    0

    Hey Tim,

    We are still on Contour the latest 1.x version of contour. We don't have the time and resources to upgrade to 3.0 because of the amount of custom controls we have.

    Dave

  • Comment author was deleted

    Jan 10, 2013 @ 10:29

    Yeah then the option with an edit record would be the way to go

    Add a page with the form in edit mode, when workflow fails redirect to this page (passing in the record id), form will be populated with record values but you'll need to specify an error message in a custom way

  • Comment author was deleted

    Jan 10, 2013 @ 11:03

    record id needs to be provided like ?recordGuid=

  • Dave Woestenborghs 3504 posts 12135 karma points MVP 9x admin c-trib
    Feb 05, 2013 @ 12:31
    Dave Woestenborghs
    0

    Hi Tim,

     

    The parameter recordGuid doesn't seem to have any affect since I upgraded to Contour 3 and started using the razor views ?

    Is there a way to populate a form with values from a record ?

    Dave

  • Comment author was deleted

    Apr 29, 2013 @ 17:49

    Would it be correct to say if I made a form with Contour 3.0 via the GUI, I cannot have custom server side validation code?

  • Comment author was deleted

    Apr 29, 2013 @ 18:32

    You still can, there is an event you can hook into that allows you to add extra validation rules, you can find it on the Umbraco.Forms.Mvc.Controllers.FormRenderController event is called FormValidate

    But it is easier with a codefirst form

Please Sign in or register to post replies

Write your reply to:

Draft