Providing InfoPath form views for new / edit / display
I never really looked into InfoPath untill SharePoint 2010 arrived. With 2010, customizing your item forms becomes a lot easier to do in combination with InfoPath. Yes, most of this was also possible with 2007, but the way to get there was a bit more complicated.
Here’s some steps you can take if you want to provide three different InfoPath forms for adding / editing and displaying your list item:
1. First, you open up your list in a browser window
2. Choose the List ribbon item to view the List ribbon buttons.
3. Select the InfoPath button, now InfoPath (which you would have to have installed of course) will open up with a default representation of the form.
4. Edit the form the way you want it to.
5. Press the little “quick publish” button in the quick ribbon, this will publish your form.
Now you’ll notice that your form becomes the default form for all actions. If you want to provide different forms for the actions, you’ll need SharePoint Designer:
1. Provide three different views in InfoPath, you can do this by selecting the Page Design ribbon tab and creating two extra forms. Make sure you don’t select the option to show the form in the dropdown menu, otherwise people can choose this form on their own (which is probably not what you want)
2. Publish your InfoPath form again to get the forms into SharePoint
3. Now open up your list in SharePoint designer. You’ll notice there’s an extra folder called ‘Item’ (or your content type name). This folder contains three pages: displayifs.aspx, editifs.aspx and newifs.aspx.
4. Open up on of the pages and select the webpart (BrowserFormWebPart) on it.
5. In the Tag Properties window, scroll down to ‘Default View’.
6. Type the name of the view you want to use
7. Save the page
That’s it; now that particular page will use the InfoPath view you specified. This way you can easily provide forms which have different options for inserting / editing and perhaps a completely different lay-out for display purposes. Cool!
Special thanks to Clayton Cobb for providing this solution at MSDN.
Leave a Reply