validation errors are not in the current view - InfoPath Dev
in

InfoPath Dev

validation errors are not in the current view

Last post 10-23-2005 09:15 PM by DavidCrabbe. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 10-23-2005 08:00 AM

    validation errors are not in the current view

    Hello.
    I have 2 views "A" and "B".
    "A" is default view.
    There are field in view "B" that cannot be blank.
    When I submit view A, I have an error that field from "B" cannot be blank, and i want just submit view "A".
    What can i to do?
  • 10-23-2005 11:35 AM In reply to

    Re: validation errors are not in the current view

    Hi,

    You could use: thisApplication.ActiveWindow.XDocument.Errors.DeleteAll(); to clear all the errors before submitting.

    Regards,

    Franck Dauché
  • 10-23-2005 09:15 PM In reply to

    Re: validation errors are not in the current view

    I got the following recommendation from Microsoft:

    Clear the "cannot be blank" checkbox for the field on view "B".

    Create an item in your data source to contain the name of the current view and use the OnSwitchView event handler to update the field name when the view changes (C# code):
    thisXDocument.DOM.selectSingleNode( "my:Form/my:InfoPathFormData/my:CurrentView" ).text
    = e.XDocument.View.Name;

    Then in the Data Validation for the control on view "B", set the "is blank" condition for your field and also put in a clause which states
    "AND" "CurrentView" "is equal to" "B"
    (Don't literally type this in! This is hard without a picture. :))

    Therefore your form will only require the field to be filled in when you are submitting from view "B" - allowing you to submit from view "A" in your example.
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.