various shenanigans.

Repairing Sharepoint List’s Supporting Pages

I was creating Custom List Forms for DispForm.aspx and EditForm.aspx on a List. The editing of these pages borked their relationship to the Supporting Files on the List.

Procedure for repairing a screwed page or list:
The old procedure was… delete the list and create it again for personalize it later using the procedure, but there is another way.

1. Open the NewForm.aspx, EditForm.aspx and DispForm.aspx in the Sharepoint Designer.

2. Search the following tag: <WebPartPages:WebPartZone runat=”server” FrameType=”None” ID=”Main” Title=”loc:Main”><ZoneTemplate> in the screwed page.

3. Paste between the tags <ZoneTemplate> Paste here <ZoneTemplate> this code:

<WebPartPages:ListFormWebPart runat=”server” __MarkupType=”xmlmarkup” WebPart=”true” __WebPartId=”{MY NEW GENERATED GUID}” >
<WebPart xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xmlns:xsd=”http://www.w3.org/2001/XMLSchema” xmlns=”http://schemas.microsoft.com/WebPart/v2″>
<Title>LIST NAME</Title><FrameType>None</FrameType><Description /> <IsIncluded>true</IsIncluded><PartOrder>1</PartOrder><FrameState>Normal</FrameState> <Height /> <Width /><AllowRemove>true</AllowRemove> <AllowZoneChange>true</AllowZoneChange><AllowMinimize>true</AllowMinimize><AllowConnect>true</AllowConnect><AllowEdit>true</AllowEdit> <AllowHide>true</AllowHide><IsVisible>false</IsVisible> <DetailLink /> <HelpLink /><HelpMode>Modeless</HelpMode><Dir>Default</Dir> <PartImageSmall /> <MissingAssembly>Cannot import this Web Part.</MissingAssembly><PartImageLarge /> <IsIncludedFilter /><ExportControlledProperties>true</ExportControlledProperties>
<ListName xmlns=”http://schemas.microsoft.com/WebPart/v2/ListForm”>{MY SHAREPOINT’S GUID FROM THE LIST}</ListName>
<ListItemId xmlns=”http://schemas.microsoft.com/WebPart/v2/ListForm”>0</ListItemId>
<ControlMode xmlns=”http://schemas.microsoft.com/WebPart/v2/ListForm”>Edit</ControlMode> <TemplateName xmlns=”http://schemas.microsoft.com/WebPart/v2/ListForm”>ListForm</TemplateName>
<FormType xmlns=”http://schemas.microsoft.com/WebPart/v2/ListForm”>6</FormType><ViewFlag xmlns=”http://schemas.microsoft.com/WebPart/v2/ListForm”>1048576</ViewFlag>
<ID>g_MY_NEW_GUID_REPLACING_DASHES_BY_LOW_DASHES</ID> </WebPart></WebPartPages:ListFormWebPart>

4. In the line of <ControlMode if the page is:
EditForm we have to put Edit
NewForm we have to put New
DispForm we have to put Display

5. In the line of <FormType if the page is :
EditForm we have to put 6
NewForm we have to put 8
DispForm we have to put 4

6. In the line <ListName we have to put the GUID of the Sharepoint’s List that we are repairing. Also change <Title putting the name of the list.
(It can be obtained in the Sharepoint Site by customizing the list or in “Site Settings > Site Libraries and Lists” and looking in the link of customize of the list appears the GUID, right clicking and copying the direct access)

The line would stay like this:
<ListName xmlns=”htp://schemas.microsoft.com/WebPart/v2/ListForm“>{046F5668-1891-4781-9B44-90AC0C0B600A}</ListName>

7. Generate a new GUID with guidgen.exe or using the page: http://www.somacon.com/p113.php

8. In the line <ID put the new GUID replacing the dashes by low dashes leaving a “g_” in the beginning. Example: If the GUID is 870850be-fd2c-44d6-818e-ab2914fb2d71 it should stay like this g_870850be_fd2c_44d6_818e_ab2914fb2d71

9. Save (I don’t recommend to save before), it is possible that you must close and open again the page to see the result of the reparation.

10. Repeat this same operation for the pages NewForm.aspx, EditForm.aspx, DispForm.aspx and all of the attachments of Supporting Files will stay repaired. By this point we would have repaired the list, the alerts, the RSS and the actions of New, Edit and Display so:

Everything will work properly

Close Bitnami banner
Bitnami