SharePoint 2010 InfoPath List Form – A Fix

In SharePoint 2010 (Beta), a SharePoint list can be created, and a InfoPath form can be quickly created as an interface to the list, instead of using those default forms that aren’t very easy to customize.  I was at a client site last week, teaching SharePoint 2010, and we noticed an issue with the InfoPath form once it has been created.  It is missing those standard fields “Created”, “Created By”, “Modified” and “Modified By” that usually show on a list form.  In this blog post, I will explain the issue I’m referring to, and show you how to fix it.

This is what a non-customized SharePoint 2010 list form looks like:

NEW

ch19[4]

DISPLAY

ch19[2]

EDIT

ch19[3]

Notice the extra “Created” and “Last Modified” information at the bottom of the Edit Form and the Display Form, but NOT on the New Form.  These fields do not exist on the new form, because there is no data for them until after the item has been created.

 

The problem is that when you convert this list form into an InfoPath form, you lose the Created and Last modified information at the bottom, as so:

  1. In the list tab of the ribbon, click Customize Form: ch19[5]
  2. Click the Quick Publish button in the toolbar at the top, the little lightning bolt: ch19[6]
  3. After the form is published, close InfoPath.
  4. Try opening, editing or creating new forms in the list, and you’ll notice that they are now InfoPath forms, BUT with that Created and Last Modified info missing, as so:

ch19[7]

It is easy to add the missing fields to the InfoPath form, but they need to be configured so that they are not displayed on the NEW form.  Insert a section in the form, and put the 4 fields in there, and set conditional formatting so that the section is not displayed when the ID field is blank.

Here’s how to do it:

  1. Click to Customize Form again.
  2. In the InfoPath form, insert a section at the bottom of the form, and type the text as seen in a default list item view, like this:
    ch19[8]
  3. Insert the proper fields from the Fields pane on the right, so that the section looks like this:
    ch19[9]
    (The field names that I inserted are “Created”, “Created By”, “Modified”, “Modified By”
  4. Select the section, by clicking the word “Section”.  Now the rule can be applied, for the conditional formatting.  Click Add Rule in the ribbon.  Create a new rule so that if the ID field is blank, the whole section is hidden.
    ch19[10]
  5. Click the Quick Publish button again, close InfoPath, and now take a look at the form’s behavior.  Now the New Form will not display that section at all, and Edit and Display forms will show the appropriate information.  Done.

 

Advertisements

10 comments

  • Short & Clear post and to the point.

    Like

  • Very helpfull post. Can you post somthing about custom new/edit form having custom buttons with form action? I am having problem in closing the modal pop after form action. Thanks..

    Like

  • Hi Laura, that’s exactly what I’m looking for, but if I just drag those fields on the form, they do not align really well, especially the persons’ fields, (I find aligning in Infopath horrible in general). If I go into the fields’ Advanced View and insert the fields as Textboxes, they show up empty. Lastly, if I use a calculated value field, the Date/Time is displayed as “02.02.2011T09:34:34”. How exactly did you insert those fields? Alternatively, can’t I use the Infopath-Form just for new items/edit items and the standard Sharepoint display form? The Infopath display form is horrible anyway, because it is showing the field comments as well which I do not want. Thanks for your time!

    Like

  • Great post You Are Rock………….

    Like

  • Damartala, The created and modified date fields were inserted as text boxes, and the created by and modified by fields were inserted as calculated fields that point to the display name of the person field. Yes, the display form is horrible. You can create a new view in infopath, and in the form settings you can change it to be the default display view.

    Like

  • How do you get the created by and modified fields ?

    Like

  • amith, Read the comment right above yours.

    Like

  • I am so happy I found this post–just what I was looking for! Thank you so much!

    Like

  • Hi Laura, thanks for all the good info you’ve posted. Unfortunately I can’t see the pics on this post to see exactly what you did? Did your Created By and Modified By fields include presence? Thanks!

    Like

  • The pictures are showing, hopefully you can see them now.

    Like

Leave a reply or question

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s