Microsoft Office SharePoint Server (MOSS) 2007 offers out-of-the-box web forms for data entry and maintenance with each list and library you create. These forms are sufficient for most tasks, but do not offer much in terms of intelligence nor do they offer the flexibility to infuse your own intelligence into the form. If you are looking for more out of your MOSS 2007 forms, you must create custom forms yourself.
There are two options available to build a custom form in MOSS 2007. First, you may write a custom ASP.net page and use SharePoint Designer 2007 (now available for free from Microsoft) to point to the page you create. Alternatively, you may use InfoPath 2007 (or InfoPath 2010, which imposes restrictions based on your target deployment environment).
If you choose InfoPath 2007, you will enjoy many built-in functions and wizards which make many of your construction and deployment tasks a breeze. InfoPath even allows you to build forms which can be displayed in a browser, eliminating the need to install the InfoPath application on the client systems! A great feature, until you discover its limitations, which brings us back to the topic of this blog.
One very common scenario is when a user is given a form to complete, and certain choices will change based on a previously selected choice.
For example, let’s use the make and model of a car. The list of models to choose from will change based on the make of car the user has selected. Here’s a brief summary of the steps necessary to build a custom in-browser filter:
1. If you do not have Visual Studio Tools for Applications installed, do so from Add/Change Programs in Control Panel
2. Open a new form template in InfoPath 2007 and add two drop-down list controls, call them Make and Model
3. Create a secondary data source for your Make/Model information
4. Create the “Changed” event for the parent control and paste this code in the event handler:
5. Be sure to set the control’s Postback settings (under the “Browser Forms” tab in properties) to “Always” 6. Publish your form as a Farm Admin and test it out!
If you are clinging to your MOSS 2007 platform and reluctant to migrate to SharePoint 2010, this workaround may help you stave off the inevitable a little longer.