Geeks With Blogs
Thorvald Bøe
I was working in SharePoint designer, trying to customize the edit form. I had two objectives:
-To customize the form by rearranging the order of the controls and adding some headings etc.
-To add a related document library at the bottom
This turned out to be a far more challenging task than I thought. My Idea was to simply add a related list on the edit form, and then customizing the html to fit my needs. To make a long story short, this is not possible, because the related list is dependent on a certain ListFormWebPart control, that renders all the controls automatically. If you want to customize the controls, you can add a new form in SharePoint designer, but then the related list option will go away.

When discovering this, I decided to leave the customizations and just go for the standard form with related documents. So I deleted the custom form. At that point, SharePoint designer crashed, and when I started it again, my custom form was still there, but the default form was gone! Oh horror!
I had already set up around 15 views on my list, so I did not particularly want to start from scratch. At first I searched the net for some solutions, but all I found was related to 2010 which seems to have other tools for this. So I took a look at the edit forms markup for two other lists, to see if there were large differences. To my relief, it was not. I found only 3:
1.A WebPartId GUID
2.A ListForm GUID
3.The title

To restore the default form, I did the following:

1.Create a new edit form and make a note of the WebPartId GUID
I created a new edit form for my list, let's call it 'Order' and set it default. I searched for 'WebPartId' and copied it. This guid seemed to be unique for this form, so we will need it later 

2.Copy another default form markup
I deleted all the markup and pasted the markup from another default edit form (let's call it 'Customer')

3.Update the ListForm GUID
The ListForm GUID occurs twice in the default markup. The correct GUID can be found in the default form for new items for 'Order' (provided you have not deleted that too, then you are probably screwed).
Replace the ListForm guids in the order form (which currently contains the guids for customer) with the one you found in the new form. At one location it is written in lower case, I don't know if that is important, but I changed my guid to lower case just in case

4.Update the WebPartId GUID
The WebPartId guid also occurs twice. For the first location, just search for WebPartId and paste the guid from step 1. For the second location, search for 'g_' and find the guid which is prefixed by 'g_' and the dashes are replaced with underscores. Here also in lower case.

5.Finally update the title, and save
And voila - the default form is back, with related list capability.

Warning:
This is a hack - I have no idea if it is safe, or if it will wreck havoc to your list, site, tenant or SharePoint online in general (hopefully none of the above). Use it at your own risk!




Posted on Monday, March 2, 2015 4:27 PM sharepoint online , form web part | Back to top


Comments on this post: SharePoint hack - how to restore web part forms in SharePoint Online (SP 2013)

# re: SharePoint hack - how to restore web part forms in SharePoint Online (SP 2013)
Requesting Gravatar...
Hack or no, I'm willing to try. I will report back.
Left by Hal Lee B on Apr 15, 2016 1:21 AM

Your comment:
 (will show your gravatar)


Copyright © Thorvald Bøe | Powered by: GeeksWithBlogs.net