Partager via


How to prevent Supporting Files from being incorrectly set to erroneous page

Symptoms:

After replacing normal list form (ListFormWebPart) with custom list form (DataFormWebPart) on any of the supporting files (New, Edit, Display) for a SharePoint list, the list view properties do not work as expected. Hyperlinks for corresponding supporting file will point to erroneous or incorrect location.

Example: replacing normal list form with a custom list form on supporting file DispForm.aspx results in "display" hyperlinks going to an erroneous page, such as a different, un-intended supporting file.

This is incredibly frustrating, right? Here is a sure-fire to prevent this from occurring.

Prevention:

  1. Open SharePoint Designer 2007. Go to File | Open Site and connect to SharePoint site.
  2. Expand out Lists -> [List Name] -> open DispForm.aspx .
  3. Highlight normal list form by clicking on it. This will select the entire web
    part.
  4. Right-click on selected web part, and choose Web Part Properties…
  5. Expand [+] Layout, check option for Hidden, click OK.
  6. With web part still highlighted, hit the right-arrow key once. Hit Enter. This creates some whitespace to insert.
  7. Go to Insert | SharePoint Controls | Custom List Form…
  8. Select appropriate list or library, content type, and type of form to create. Click OK.
  9. Save page.

NOTE: The steps above are how to prevent supporting files from being incorrectly set to erroneous page, not how to fix a pre-existing problem. That's quite a bit more tricky.

Keeping the normal list form on the page should ensure the supporting files stay intact. Think of this as a sort of “best practice” and you should never run into the problem again.

Additional Information:

KB 935504 - Error message when you click "New" to create a new item in a list or when you click an existing item in SharePoint Server 2007 or in Windows SharePoint Services 3.0: "Invalid page URL" or "An unexpected error has occurred"

Comments

  • Anonymous
    June 02, 2008
    Hi, Have you tried this when you have custom list forms for mulitple content types on the same list? The supporting files only seems to work when one content type is used. After struggling with this for days we ended up setting the supporting files via the API rather than by SPD. I'd be interested to see if there's a way to get this working via the SPD interface. Thanks Glyn

  • Anonymous
    June 06, 2008
    The comment has been removed

  • Anonymous
    June 10, 2008
    Hi, The difficulty we had was with the following scenario: A custom list with two content types associated with it We created two custom list forms We then went to the supporting files tab and selected the necessary content type from the drop-down - and selected the relevant custom form Unfortunately, every time we clicked save it changed the custom list form to be the same for both content types. Nothing we did could get the two content types to have different forms. If you've definitely got this working then perhaps I should try again - but we tested on a couple of different environments and made sure we had the latest SP. Happy to share (but I didn't do the dev work, so it may not make much sense!) - via the API, we got a reference to the list and then got a hold of all the content types on the list; we then were able to set the newform/editform etc for each content type. We created a custom administration page for the list that allowed you to select any aspx pages in the list so that it didn't have to be hard coded. Thanks

  • Anonymous
    September 21, 2008
    The comment has been removed

  • Anonymous
    October 01, 2008
    Hi Michmon and Mike, Did you found out the solution to your problem without deleting the LIst... I am facing the same problem, Please help me.

  • Anonymous
    May 20, 2009
    The comment has been removed

  • Anonymous
    May 26, 2009
    Sorry for moaning but from what I found out so far it is quite dangerous to customize SharePoint forms at all. If you do not follow an exact procedure (which is not explicity stated by Microsoft) you end up with broken forms. The normal approach in all other environments to make a backup copy of a file before you modify it does not help you with SPD at all. If you try to revert your changes by simply restoring the backed up file things stay broken or even more worse get broken by this procedure. I also see the danger that more peolpe will get their hands on SPD cause it is for free now and breaking sites of the comanies they work for becuase thei are not aware of these pifalls. In the end this will not help to get a better reputation of SP. MS should have fixed these shortcomings quickly (at least to give a possibility to sucessfully backup items before you modify them) but they are still present in SPD SP2. Just my 2 cents