Save Event - Determine If Validation Errors Exist - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Save Event - Determine If Validation Errors Exist

Last post 11-19-2012 10:01 AM by kcorbet. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 11-16-2012 07:49 AM

    Save Event - Determine If Validation Errors Exist

    Hi InfoPathers,

    I am attempting to prevent users from saving a form if there are validation errors.  Note: I cannot eliminate the ability to save, as I offer the ability to save forms locally for offline use.

    Users are abusing the save functionality to override field validation.  Is there a way in the form save event ('07 Form Filler Template) I can determine if validation errors are present so I can exit sub if True (existing code written in VB)?

    Thank you!

    Kevin
  • 11-19-2012 09:45 AM In reply to

    Re: Save Event - Determine If Validation Errors Exist

    Is there some sort of submit functionality that commits the form at the end?  If so, then it should be okay to save the form with validation errors as long as they are cleared before submit occurs.  Otherwise, you're looking at custom code for sure and unfortunately not sure off the top of my head if its even possible to block save.
    Anson Hidajat
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™

  • 11-19-2012 10:01 AM In reply to

    Re: Save Event - Determine If Validation Errors Exist

    Hi Anson,

    Thank you for your reply.  The submit button does what I want, prevent submit from occuring if there are validation errors in the form.

    The Save or Save As buttons are the issue.  This is because it will prompt the user if there are errors, but the prompt allows the user to continue with the save.  I want to disable saving if there are validation errors.

    I am currently utilizing custom code in the save event handler that checks a couple fields to see if they contain a prohibited value, if so exit sub (prevent saving).  I could continue with this approach using custom code for all the fields that have validation, but this would be exhaustive and require heavy ongoing maintenance.

    It seemed to me that there may be some VB code that could count or true/false if there are validation errors in the form.

    Kevin
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.