Customize standard error messages - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Customize standard error messages

Last post 03-28-2008 05:00 PM by Greg Collins. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 07-09-2007 05:41 AM

    Customize standard error messages

    I have an IP 2003 form with secondary data connections to a SQL Server 2005 database that populates my lookup values for dropdown controls. Sometimes people try to use the form that do not have access to the SQL Server db so they get the standard default error message. How can I replace that message with my own message with instructions for requesting access to the db?

    TIA
    Dean

    Dean
    Charlotte, NC
  • 07-09-2007 11:46 AM In reply to

    Re: Customize standard error messages

    The only way you can do this is to use code to call the data connection, then trap the error in a try catch block and pop up your own Alert message instead. Thanks.
    Shiraz Cupala / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 03-26-2008 12:04 PM In reply to

    Re: Customize standard error messages

    I Guys,

    I have a similar problem.  I am trying to display all error validation messages onSubmit. The code I am using does kinda work, however, its giving me the namespace of the item instead of a field name or custom name.

    for example instead of displaying:

    "StatusDate cannot be blank"

    its reads

    "<my:StatusDate xmlns:my"http://schemas.microsoft.com/......"></my:StatusDate> Cannot be blank"

    code I am using: 
    for (i=0; i < XDocument.Errors.Count; i++)
    {
    objError = XDocument.Errors.Item(i);
       XDocument.UI.Alert("Error message: " + objError.Node.xml + " " + XDocument.Errors.Item(i).ShortErrorMessage);
    }

    Thanks

    @lphamax
  • 03-27-2008 03:54 PM In reply to

    Re: Customize standard error messages

    You probably don't want "objError.Node.xml"... you are probably looking for "objError.Node.nodeName" or "objError.Node.baseName".

  • 03-28-2008 11:29 AM In reply to

    Re: Customize standard error messages

    That did it

    Thanks

    Thanks

    @lphamax
  • 03-28-2008 05:00 PM In reply to

    Re: Customize standard error messages

    Great! Glad to have helped out.

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