Handling Validations in multiple views in infopath form - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Handling Validations in multiple views in infopath form

Last post 04-24-2012 02:24 PM by Hilary Stoupa. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 11-29-2011 02:12 AM

    Handling Validations in multiple views in infopath form

    Hello All,

    I have an infopath form which contains 12 views. we are publishing infopath form as browser enabled form.

    I have configured all the views (i.e. controls in each view)  with mandatory conditions using rules.

    When i am submitting the form with one view, all the other views validations are also firing and form is not successfully publishing to the sharepoint form library.

     Could anyone please let me know how to enable only the current view validations to fire when submitting the form.

     Please help me in this regard.

     

    Thanks,

    Narasimha Murthy. B

     

  • 11-29-2011 03:12 AM In reply to

    • Skarn
    • Top 50 Contributor
      Male
    • Joined on 04-20-2008
    • Australia
    • Posts 198

    Re: Handling Validations in multiple views in infopath form

    I can't think of a way which won't involve going back through the fields on each view and adjusting the validation rules.

    You could try using a field to hold a 'submitView' value.

    Then on each view which has it's own submit button, the first rule of the button would be to set the 'submitView' field to an identifying value for that view.

    Then on each view add a condition to each of the validation rules that the 'submitView' field equals the identifying value for that view.

    This way each view's validation rules will only fire if the associated value is set in the 'submitView' field.

  • 11-30-2011 04:24 PM In reply to

    Re: Handling Validations in multiple views in infopath form

    Skarn has a good thought there for handling this. I'd like to address what I think the root misunderstanding here may be though - If a field has validation on it (even the simple "Cannot be blank" checkbox in the field properties), InfoPath doesn't care if the field is visible to the user in the view - or on the template at all. The validation is going to fire no matter what the view, because all the fields are included in the main data source and all the validation is going to be checked on submit.
    Hilary Stoupa

  • 04-24-2012 01:27 PM In reply to

    Re: Handling Validations in multiple views in infopath form

    Hilary,

    What would the solution be then for this?  I have a form with two views and two separate subit methods but I cannot get past the validation errors with rules.  Can qRules handle this?

  • 04-24-2012 02:24 PM In reply to

    Re: Handling Validations in multiple views in infopath form

    If you are closing your form, you could use qRules - ClearErrors removes all errors - there is no way to reinstate them until the form is re-opened.

    If it were my form, I'd use validation rules and have another field letting me know if the form was in a state when specific fields were required. So, pretend the initial view is for customer information, and a later view asks for sale information. qRules has a field that stores the value of the current view name (/QdabraRules/View/@current) - you could use custom validation based on that - say, set a validation rule that if the TotalPrice field is blank and the current view is "Sales", throw a validation error.

    Hilary Stoupa

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