Home

Wednesday, March 21, 2007

SharePoint V3: Configuring Custom NewForm.aspx, EditForm.aspx, DispForm.aspx

NewForm.aspx, EditForm.aspx, DispForm.aspx represent the web pages that the SharePoint user sees when they click the New , Edit, or Display actions from a custom list web part tool bar, or from an "Linked to Edit Item" drop down.

In SharePoint deployments, it is fairly common to have a requirement to override these pages with custom pages. You would want to do this when you want to hide fields from a user, or when you want to enhance the appearance of the page for the user.

One example of where I needed to do this is on a custom list where I had configured a SharePoint Designer workflow. The workflow was fairly complex and I had configured some extra fields on the custom list to facilitate the workflow. I didn't want the users to see these extra fields when they were creating, editing, or viewing items in the list so I had to hide these fields.

Here are the steps to configuring custom NewForm.aspx on an existing custom list. These steps may also be used to configure custom EditForm.aspx or DispForm.aspx.

* SharePoint Designer > File > Open Site
* Expand the lists folder
* Expand the custom list that you are modifying
* Double click NewForm.aspx to open it
* File > Save As
* Name the custom list something unique (do not overwrite the default NewForm.aspx) e.g.
* NewFormCustom.aspx
* You will see a generic SharePoint control in the center of the page with column 1, column 2, column 3
* Right click the SharePoint control that is in the center of the NewFormCustom.aspx page, Cut to remove it from the pageInsert > SharePoint Controls > Custom List Form
* Right click within the Custom List Form SharePoint control to invoke the menu.
* Modify the Custom List Form SharePoint control.
* File, Save
* Right click the custom list container > Properties
* List Properties > Supporting Files Tab > Configure this tab accordingly, pointing NewItemForm to NewFormCustom.aspx
* Apply, OK
* File, Save

If you need the revert back to the original NewForm.aspx, you can open the list properties from SharePoint Designer, navigate to the Supporting Files tab, and point the NewItemForm property back to NewForm.aspx. Furthermore, if the requirements change, the original NewForm.aspx is still in tact and you have the option to create additional, custom NewForm.aspx pages.

Words of caution about working with the NewForm.aspx, EditForm.aspx, and DispForm.aspx:
* Always create a web part template of the custom list or document library as a backup, before making changes
* If the custom list or document library has workflow, take the additional step of creating a site template or backup the site collection entirely using stsadm
* Never rename the default NewForm.aspx, EditForm.aspx, or DispForm.aspx pages. This will corrupt the custom list. When you click on Edit Item you will receive an error, "Invalid URL." Instead use the steps above.
* After switching to the custom form, attachments are no longer supported on the custom list. If you try to add an attachment you will get an error, "This form was customized not working with attachment."


UPDATE:

Microsoft published a knowledge base article addressing the attachment issue:

Microsoft KB 953271:
Error message when you try to attach a file in a custom form on the Web site in Windows SharePoint Services 3.0: “This form was customized not working with attachment"
http://support.microsoft.com/kb/953271

18 comments:

Anonymous said...

I find it strange that attachments won't work after creating a custom form. There seem to be a solution available, but it doesn't work for me.

Anonymous said...

Hi,
Do you know why the page is not changed after you do
* List Properties > Supporting Files Tab > Configure this tab accordingly, pointing NewItemForm to NewFormCustom.aspx

It's still NewForm.aspx.

Nicholas Bisciotti said...

Yes, on the list properties screen where you change from newitemform to newformcustom.aspx, make sure that the Content Type Specific Fields drop down is set to "Item" and not "Folder."

Nick

Anonymous said...

My Attach File button is not working anymore. I received the same Error Message: "This form was customized not working with attachement."

Anonymous said...

How do this without using office designer

Anonymous said...

Hi,

I managed to curropt my lists . How can I restore the site back to its original uncorrupt state...

Thanks,
Sam

Nicholas Bisciotti said...

Restoring site...do you have either a site collection backup or a full farm backup?

Anonymous said...

when doing this for displaying the form,

why will the attachement file not display and also dissappears from the datasource.

i have followed this through to create a DispForm, however i cannot get it to display the attachment.

any pointers?

thanks in advance

Anonymous said...

Hi
I'm having the same difficulty in setting the page of the customised page in the properties tab in Sharepoint Designer.
For some reason my content type specific forms shows the name of the list in the dropdown and not 'Folder' or 'Item' so it always refreshes back to the original newform.aspx when I return to the properties.
The only difference I can see is that my list is within a meeting workspace, is this an issue?

Also how can I add the new form to a production site and set it as the default, without using Sharepoint Designer?
Thanks

Anonymous said...

Thanks very much - this worked perfectly!

MaxPower555 said...

Hey Mate,

Thanks heaps for this work around! Worked a treat! (Alot better then the microsoft site's way of doing things)

One thing to keep in mind guys, when doing this, make sure it creates the custom list form in the web part zone otherwise it wont work.

Anonymous said...

Hi Nicholas,

Great post.Can you please post how to customize the appearance of the New form.aspx .I am frustrated with the sharepoint look of the constant lengths of the fields and not able to group.

I tried but could not overwriet the css classes for eg: msbodyform,msbodylabel..

please advise.

Thanks,
Sub

RBsandoval said...

You can get your attachment view features back by doing the following: http://support.microsoft.com/kb/953271

RBsandoval said...

You can get Attachment Features back. This method worked for me.
http://support.microsoft.com/kb/953271

RBsandoval said...

I do not see or get the options described here. I am on SPD v.12.0.6320.5000.

* Right click within the Custom List Form SharePoint control to invoke the menu.
* Modify the Custom List Form SharePoint control.
* File, Save
* Right click the custom list container > Properties
* List Properties > Supporting Files Tab > Configure this tab accordingly, pointing NewItemForm to NewFormCustom.aspx
* Apply, OK
* File, Save

Anonymous said...

Thanks for the brief steps.

Custom Paper Writing said...

Many institutions limit access to their online information. Making this information available will be an asset to all.

Anonymous said...

Works Great!!! Tanks!!

Blog Archive

Followers