spacer
cornerspacercorner
Reply
Advisor
USDA
Posts: 37
Registered: 06-16-2010
0 Kudos

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. 

Esteemed Contributor
Jerome҉
Posts: 740
Registered: 05-18-2010
0 Kudos

Re: Verify data when SUBMIT button is clicked

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.

Occasional Advisor
Tony Tran
Posts: 21
Registered: 05-21-2010
0 Kudos

Re: Verify data when SUBMIT button is clicked

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

                                }

                  }

Esteemed Contributor
Jerome҉
Posts: 740
Registered: 05-18-2010
0 Kudos

Re: Verify data when SUBMIT button is clicked

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.

line spacer line
spacerFollow Metastorm on:
spacer Twitter YouTube Blog iTunes LinkedIn Metastorm Community Central, MC2
spacer Copyright © 2011 OpenText Corporation. All Rights Reserved.spacer About Metastormspacer Privacyspacer Legalspacer Site Mapspacer RSSspacer Contact Us
Microsoft Gold Certified Partner
Powered by Windows Azure
line spacer line