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 (7)

  1. Glyn says:

    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

  2. michmon says:

    Hi Glyn,

    Thanks for the comment. I’d be interested in knowing how you got it done via the API. Care to share for others? 🙂

    This can be done via SPD, and each content type can have their own respective New, Edit, and Display form (if desired). That doesn’t go without saying that the Supporting Files can surely get out of whack, though. What kind of troubles did you have, specifically?

  3. Glyn says:

    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

  4. Mike Atkins says:

    Is there any way around the problem of getting "Invalid page url" after one has deleted the List Form?  Deleting the List does not seem like an option for me at the moment (I have workflows attached).

  5. Amitabh says:

    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.

  6. Repairing Supporting Files: “SharePoint alerts doesnt work” & “Invalid page

    URL”

    Follow these steps to correct the problem

    http://sharepointworks.blogspot.com/2009/05/repairing-supporting-files-sharepoint.html

    Everything will work properly

    Thaks,

    RobertoMarcos.com

    sharepointworks.blogspot.com

  7. grubi says:

    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

Skip to main content