Saturday, May 27, 2006

InfoPath 2003: Tips

1. Create a “please wait” and a “start up” screen when you receive or submit data to a data source.
(Use a combination of the OnContextChange and OnSwitchView InfoPath methods to create such please wait views.)

2. Use the Wingdings font to show images on buttons

3. Provide a static class in JavaScript or C# which contains methods to obtain data fields of your form. It will save you a lot of code to get and set data in your form!

Example:
my:myFields
---- my:Customer
--------- my:CustomerName
---- my:Product
--------- my:ProductName

> Use: Path.GetInstance(thisXDocument).GetCustomerItem(“my:CustomerName”)
> Class: Path
> Static Method: GetInstance(XDocument thisXDocument) [singleton pattern]
> Methods GetCustomerItem() (to retrieve object(s) of IXMLDOMNode = return type)

4. Avoid cycles, think about the need of rules,

Please think about ...

  • how many rules I will need,
  • which fields must have rules.
  • ...

    (Without this analysis, you will create cycles in complex forms)
    (Too much rules are not maintainable)

5. Let's hope that InfoPath 2007 will provide more functionality:

  • Clickable images
  • Support for repeating sections within other repeating sections (no recursion)
  • a list with all rules and conditional formatting per control and field