With the introduction of InfoPath 2007 came browser based forms that could be used with several different browsers but with some limitations (Official document on "Web browser compatibility in InfoPath Forms Services"). The Contact Selector (ActiveX control) is very nice but it doesn't do everything and it's not compatible with other browsers that don't support ActiveX controls. I've looked for other reasonable solutions but haven't found anything yet. So I came to the conclusion that I needed to build something on my own that would not require any custom code in InfoPath 2007 but could be reused by any other form. Shortly after making this decision I learned my current client needed the same capability but only to retrieve account names from Active Directory.
With my limited time to complete this for my client it was pretty simple on how I was going to do it but was not really happy with solution because I thought it could be done better but I just don't have the knowledge of other technologies to know what is possible with InfoPath 2007 and don't want to write custom code in the form source because of support reasons. The solution was built as an InfoPath Form Template Part with 3 controls (search box, search button and search results list box) and .NET Web Service solution that uses LDAP to query Active Directory by the user last name. This solution was easy to build and met the immediate needs and most importantly met the need of being able to reuse it in any InfoPath 2007 form.
Over all everything works fine but some of the baggage is what I've been struggling with and thinking there has to be a better solution. The items I'm struggling with are listed below and if anybody has any suggestions I would be more than interested learning about them.
- Adding the control more than once to the form creates another Section to the data source, naturally. It would be nice to learn how to reuse the same control data source.
- Using the same Secondary Data Source causes all other search results box to be pre-populated. Client likes this feature but it drives me nuts but the old saying says the client is always right.
- The search control fields stay visible on the form unless the user manually minimizes the section. Is there any way to have a pop-up without writing custom code?
- Search box doesn't execute the search query when hitting Enter key. What simple thing is missing hear?
Overall the functionality of this simple solution has outweighed my troubles but it would be great if it could be better. The solution has already been reused to bring back email addresses instead of usernames and it was pretty much a copy and paste in the .NET Web Service solution with a little query change and duplicating the InfoPath Form Template and changing the data connection.
Well it's time for me to get back to work.
Cheers