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 ?
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
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
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.
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
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
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
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
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
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
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
record id needs to be provided like ?recordGuid=
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
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
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
is working on a reply...