Verify data when SUBMIT button is clicked

Does Metastorm BPM v 7.6 provide a way to custom verify data fields (Metastorm design form) when the SUBMIT button is pressed?  Process code will check only when the user selects another field if the wrong data is entered, but, if the user enters the wrong data and goes directly to press the SUBMIT button, the process is bypassed and the bad data is submitted into the database. 

Tagged:

Comments

  • There used to be a registry setting that would make the engine trigger every 'when changed' event on a submit. If you use %User.Error or ProcessContext.UserError (dedpending on your version), setting this to "1" would make it work as you desire.

     

    I cannot recall the entry offhand, and am not sure how/if it can be set in version 9.

  • Try this and let me know

       1- Have a hidden variable on your form to serve as a validation value (iValidData)

       2- On form do this/When user saves form – run a script to validate your data entry

               a. If valid, save your data

               b. If not assign 1 to hidden validation variable

       3- On form Client extension, use OnSubmit event, and run the Jscript script below to allow or stop the completion of the submit event.

     

                    function ValidDataScript()

                   {

                        var iValidationValue

                        iValidationValue = eworkGetField("iValidData","");

                            if (iValidationValue==1)

                                  {

                                     alert( "Invalid Data" );

                                     return false; // Stop submit to complete

                                   }

                           else {

                                      return true; // Allow submit to complete

                                    }

                      }

  • The problem there, Tony, is that the server side validation has not been triggered. You would have to do both server side and client side validation for every relevant field (if the latter is even possible in this case) in order to make this work.