Crow Canyon Software Forum

Forum Navigation
Please or Register to create posts and topics.

After validation fires and fails, pre-Save Process event will not execute

Hi,

We have a form with a Save button and a Submit button.  The idea is that Save allows the user to save the form without all required validation in case the user doesn't have all required values when the form is first created.  The Submit button forces the required validation before Submitting the form.

Submit will enable validation by setting a field (called Status) value in the pre-Save process - in this case to "Submitted", required fields are checked, and the validation messages show.

The problem is, if the user then clicks the Save button, the pre-Save process event of the Save button javascript is not executing because the validation messages are still showing.

I have also tried using a Custom Action instead of the Pre-Save Process to set the Status field back to "Pending" when Save is clicked, but the same situation.  We cannot clear the validators that have fired.  Any suggestions?

 

 

Hi Brian, when the person presses Submit, doesn't that close and submit the form? Why would they still see the Save button at that point?

Hi Scott - No, when submit is clicked with nothing entered, the Status is set to Submitted in the pre-save, which is a condition for our "Required" columns validations.  So the form doesn't submit, the validators fire as expected, we see the required validation message.  At this point, our requirements are the user should be able to save without submitting so they can come back to the form and finish at a later time.

Hi Brian - We had a similar need and this what we did. On the form we hid the Save Button in Layouts and Theme, and then created 2 custom "Submit Action" buttons: <Submit> <Close>.

  • When the <Close> (or save) button is clicked the Pre-Save Process sets a column called "Wait" to "Yes", and alerts the user that the form won't be processed yet.
  • When the <Submit> button is clicked it sets "Wait" to "No".

A workflow then runs (when an item is created/modified) which checks the "Wait" column, if set to "Yes" it stops processing, and if set to "No" it calls the main processing workflow.

This works well for us.

Brian has reacted to this post.
Brian

Thanks pf-amalin!

We are going to follow a similar path, the bottom line was after validators fire and are shown, the "submit actions" buttons Pre-Save code is not called if the validator messages are still visible (It's like the page doesn't post back to even get to the pre-save code).

We had to abandon showing the built-in validator messages and show our own message if the required fields are not completed.

 

Brian.