custom error message browser based form in infopath 2007 - InfoPath Dev
in

InfoPath Dev

custom error message browser based form in infopath 2007

Last post 03-28-2011 05:16 PM by Hilary Stoupa. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 03-28-2011 04:38 AM

    • BMARU
    • Not Ranked
    • Joined on 03-25-2011
    • Posts 24

    custom error message browser based form in infopath 2007

    How can we show custom erro message in infopath 2007 with browser based forms....

     

    as we have in 2003 infopath like below

    try{  
      if(XDocument.Errors.length!=0) // analyse are there some errors in the form
      {    //show the message of the first error in the form
        XDocument.UI.Alert(XDocument.Errors.Item(0).DetailedErrorMessage);
      }
      else
      {     //submit the form to a database
        XDocument.Submit();
      }
    }
    catch(ex)
    {
        XDocument.UI.Alert(ex.message);
    }

  • 03-28-2011 05:51 AM In reply to

    Re: custom error message browser based form in infopath 2007

    Well, you could set a field in a secondary data source to the ex.message and if that field was mapped to the view, it would show the error message.

    Patrick Halstead
    Project Manager at Qdabra
  • 03-28-2011 10:49 AM In reply to

    • BMARU
    • Not Ranked
    • Joined on 03-25-2011
    • Posts 24

    Re: custom error message browser based form in infopath 2007

    Can you please provide sample code for that?

  • 03-28-2011 05:16 PM In reply to

    Re: custom error message browser based form in infopath 2007

    This MSDN link may help you. Just add a secondary XML data source to your form, and have a node in it that you set to your error message. Display the node on the form when it has a value. Add some logic to clear the error -- maybe an "OK" button on the form or something.

    Hilary Stoupa

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