Fix broken SharePoint Lists

_SP2007

A while back one of our calendars stopped working and later on also one of our workflows didn’t work anymore. The workflow would not start any new workflow instances and the currently running instances could no longer be edited. Everything would end up in Error Occured. One thing both had in common: Every time you would click on an event or a task it would kick you back to the main page. Checking on the link it would no longer show ex. http://<servername>/<sitename>/<etc>?ID=190, it would only show http://<servername>?ID=190.

The SharePoint calendar we simply recreated. In case of the workflow, after days of research, it turned out to be a broken (task) list.

The way to find out is to open the site with SharePoint Designer, select the list and under the list you will find several .aspx pages (item forms) like NewForm.aspx, EditForm.aspx, DispForm.aspx etc. Right click to see the properties of the list and you might see that one of the item forms show an empty field. Without the DispForm.aspx no new workflow tasks can be created and no workflow task forms can be opened. 

Further checking on the particular form item you would see that the List Form WebPart is missing.

In this case make a backup of the broken list and add the List Form WebPart back in to the item form. Therefore you open one of the other item forms in code view and copy whats between the <WebPartPages:ListFormWebPart> and  </WebPartPages:ListFormWebPart> block of code into the same space on the broken item form. Now you only need to modify this code to make it work for your item view.

modify the:

  • &ltListName (not necessary if code was pointing to the same list)
  • ControlMode =
  • FormType =
  • _WebPartId=”{Form GUID}”
  • <ID>g_[Form GUID]</ID>

For the Form GUID create a new GUID and copy it in its place.

The ControlMode and FormType depend on the item view you want to recreate.

NewForm.aspx ControlMode=New, FormType=8
EditForm.aspx ControlMode=Edit, FormType=6
DispForm.aspx ControlMode=Display, FormType=4

Source: http://moblog.bradleyit.com/2008/10/broken-sharepoint-list-forms.html

Update: The other day it happened again. A list on one of the SharePoint sites broke.

Below that’s how the NewForm.aspx, EditForm.aspx, and DispForm.aspx should look like. If the page is empty something is not right.

A right-click on the list / properties will also show that one of the Supporting Files is missing in the list. The list can no longer be edited.

The same symptoms, but this time I was unable to rebuild the EditForm.aspx manually as descript above. Then I came across a much easier way to recreate the xxxform.aspx using SharePoint Designer.

– On the File menu, click New.

– On the Page tab, click General, and then double-click ASPX.

– On the Insert menu, point to SharePoint Controls, and then click List Form.

– In the List or document library to use for form list, choose the list or library for which you want to create a form. 

 

– Indicate whether you want to create a New item form, an Edit item form, or a Display item form.

– Afterwards the ASPX page that is not attached to a master page. Go to the Format menu, point to Master Page, and then click Attach Master Page. In the Select a Master Page dialog box, click Default Master Page, and then click OK.

– To save the new custom list form, on the File menu, click Save as. In the Save As dialog box, in the large list box, browse to the list or library folder for which the custom list form was created.

Then connect the newly created form to the List …

Is this Pages usefull? Usefull Useless 1 of 3 people say this Pages is usefull.