OnSaveRequest : how to test mandatory fields - InfoPath Dev
in

InfoPath Dev

OnSaveRequest : how to test mandatory fields

Last post 02-22-2006 08:53 AM by rocknbanas. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 02-22-2006 06:05 AM

    OnSaveRequest : how to test mandatory fields

    Hello everyone !

    I have built some code managed (in c#) InfoPath forms, which have some mandatory fields. I have this question :
    - Is there a way to know if all mandatory fields have been filled by the user from the OnSaveRequest event ?

    I need to code that in my project. I know I can parse the xml data using XPath. But my forms might change in the future, and I want to avoid hardcoding. Since InfoPath shows up a warning message when the user saves the form even if he did not filled all the mandatory fields, I guess this can be also done by code. But I can't find how.

    Thanks in advance,

    Yann.
  • 02-22-2006 08:39 AM In reply to

    Re: OnSaveRequest : how to test mandatory fields

    Hi,
    You can use the thisXDocument.Errors.Count , to check all mandatory fields are filled or not(validation errors),

    I hope this will help you,

    Thanks.

    K.Ramana Reddy
    K.Ramana Reddy / http://www.ggktech.com
    India.
  • 02-22-2006 08:53 AM In reply to

    Re: OnSaveRequest : how to test mandatory fields

    Thanks a lot for the answer. I'm going to use that.

    Cheers,

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