Individual New,Edit and Display forms for SharePoint using infopath forms


Customizing the SharePoint forms using Infopath is easy in SharePoint 2010.  You have a “Customize Form” option under List Tools -> Lists in the ribbon when you are in the list view. Below screenshot shows that option (highlighted in red).

listview

On selecting this option, the form(Edit) is opened in Infopath Designer. Here you will be doing the changes in one infopath form(Edit) but, once you publish the form, the changes will be reflecting in all the three forms (New/Display/Edit).

So what if you want to edit three different forms in three different ways? Say New form should have all columns displayed, edit form should have some fields disabled where user cannot modify the values and display form having a different layout altogether.

Infopath solves this purpose by providing Views. We will be creating 3 views for each of the forms (New/Edit/Display). Follow the below steps to create separate views for each form.

  1. In the InfoPath designer, where your form is opened, , click on Page Design tab on the ribbon.
  2. You would be able to see the list of views available as a drop-down and also an option to create New View. You will be already having a view named Edit item (default) displayed in the drop-down.6581
  3. Already having a view for Edit form, we have to create 2 new views for New & Display. Click on New View.
  4. In the pop up opened type the name of the view(say Display Item) and click OK.
  5. Now you have an empty view, where you can add fields(from right side pane displaying fields from datasources), modify the layouts, adding rules, hiding columns. The changes you do in this view is going to affect only this view. If you want to replicate the views, just select all & copy the contents from one view & paste it in your new view.
  6. You can create another view (New Item) following the steps 3-5.
  7. Once you have created the views and done with your changes, publish the form.
  8. Now having 3 views for 3 different forms, you need to make your SharePoint list aware that which form to use which view.
  9. Open the list in SharePoint Designer, in the lists detail page, under Forms section, generally you will see DispForm.aspx, NewForm.aspx, EditForm.aspx. In addition to that since you have edited this list in infopath you will see 3 more forms namely displayifs.aspx, newifs.aspx & editifs.aspx.
  10. You need to set your views for each of this form. For each of the forms do the following steps.
  11. Open the form, select the form(highlighted in below snapshot), right click and select properties.6582
  12. In the properties window opened, under Misc header, set the DefaultView value to the view name you have created.
  13. You will be setting the values as below
    Form Name Default View Name
    displayifs.aspx Display Item
    editifs.aspx Edit item
    newifs.aspx New Item
  14. Now browse the list in IE to see different views set for different forms.

You can follow this for different SharePoint versions with classic mode & not with the SharePoint Modern lists.

Hope the post helped you. Feel free to leave your comments below.

22 thoughts on “Individual New,Edit and Display forms for SharePoint using infopath forms

Add yours

  1. Great article on how to customize the views and how to make them work in SPD 2010. I am currently working in Office 365 2013. I created 3 views, New Item (default) Edit Item, and View form. Then when I go to SPD 2013 I cannot find the properties. I have displayifs, editifs and newifs but I cannot figure out how to assign a view to each one of the ifs files. Have you had any luck in making this work in 2013?

    Thanks
    Keith

      1. Hi Bryce,

        See my comments a little further down, they may help you.

        Something I’ve started to do for custom forms now is actually use javascript, with the spservices jquery library and HTML to build my own forms. Then on the default form page you can add in a content editor webpart and link your HTML/JS file to it to display your custom form.

        To hide the default form, edit it’s webpart and under the layout section check the hidden box. Do not delete it! If you do your custom form will not display.

        Dan

    1. Would be WONDERFUL is you would actually explain how to edit ONLY the newform.aspx (vs the edit form). This is majorly uncovered. There seems absolutely no way to modify the newform (for example, when I want to collect ONLY a small bit of data on a new item, and workflows populate other columns/fields for me. I do not wish to present these “other” fields on the new item form.

      1. Pat,

        If you just need to hide some of the columns in the newform.aspx, then I would suggest using a content editor webpart & add some jquery code to hide the unwanted columns. Below is a sample code

        $(‘nobr:contains(“Status”)’).closest(‘tr’).hide();

        This code would hide a column whose display name is “Status”.

        Hope this helps.

  2. I’ve created my New and Display views in InfoPath 2010. However, when I open the forms, in SP Designer 2010, I cannot get any properties to display. Also, when I set a default value on one view it applies the default value to all views. What am I doing wrong?

  3. For whatever reason, I had to add a new InfoPath form webpart to the form pages. However, when I set a default value on one view it applies the default value to all views.

  4. This is a great description of how to make different views, but really needs to be brought up to date to work with SPD 2013. Been trying for a long time to have a different form layout display for new and view but without the ability to change the default view (it’s not in the code as far as I can tell) I think it’s impossible.

    I’m begging for further enlightenment!!!

  5. Just had a shocking revelation that I was massively over complicating this issue in SharePoint 2013.

    To have different forms for different views create them in InfoPath as detailed above. Once you’re happy with your forms save the file and publish to SharePoint. Now the super easy part that I overlooked from the very beginning…

    To specify which form design is shown for which view, navigate to the view you want to change, edit the page, edit the InfoPath Form WebPart and listed in the views on the right hand side of the page in the webpart options are all your different views you created in InfoPath. Pick the view you want and click OK.

    Simple as that, no rules, no code. Wish I’d come across this sooner! 😦

    1. I’m drowning in this issue, Dan, and your solution seems like the best one … I’d love a screenshot or 2 … or 5 …. I know it’s been a while since your post … not sure if you’ll see this …

      1. Mary I can also help you if you need it as well. Are you asking how does one change the default view within InfoPath and then have different views when looking at it within SharePoint?

    2. Dan: just had one of those moments when you read someone else’s shocking revelation and it leads to your own. I have no idea why this isn’t better documented elsewhere when talking multiple forms in SharePoint lists but your extremely helpful comment (not to say the very good original article also) have really helped me.

      Thank you!

  6. A new related question. If you use infopath, the Title links do not work in the list. it does not display (open) the information related to the added item. looks like this only works when using the built-in SharePoint forms. Is this correct?

  7. This issue hanted me for along time. On a lo of fora it is explained that only the edit and display form can be created in InfoPath, but people here are right, we need a video tutorial for this because it is very easy in SharePoint 2013 where obviously just a few people know the trick. Wish I had time to create a tutorial.

  8. I have a document library with a custom form. I created a few different views, one in particular is an update view of the form. After publishing the form, there are no editifs, displayifs and newifs. Just, the defaults, editForm, DispForm and one Upload.aspx. So I created a new form page but none of the awesome directions provided above applied. I am trying to create a link to the update form from a workflow but those directions don’t work without being able to have the page with the custom form to use in the workflow. What is the deal with this?

Leave a reply to Chanakya Jayabalan Cancel reply

Create a website or blog at WordPress.com

Up ↑