3

I have made Custom Content Type, and List Definition from that Content Type. What I'm trying to do now, is create custom display/edit/add forms for List Item, and when user clicks on Add New Item, navigate to add custom form ( AddItem.aspx for instance ). This is the schema definition of my List

<XmlDocuments>
  <XmlDocument NamespaceURI="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms/url">
    <FormUrls xmlns="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms/url">
      <Display>_layouts/Tests/ViewProject.aspx</Display>
      <Edit>_layouts/Tests/EditProject.aspx</Edit>
      <New >_layouts/Tests/AddProject.aspx</New>
    </FormUrls>
  </XmlDocument>
</XmlDocuments>

But clicking on the Add new Item causes error, and the url of the link is http://myserver/_layouts/listform.aspx

Anybody can help me with this ?

2 Answers 2

1

Forms can be easily created with SharePoint Designer. Go to your library, click List ribbon and "Edit list in SharePoint Designer" on the right. If you didn't have it - install it.

In SPD go to desired list and look for "Forms". Then use "New" button and add any type form you need.

Advice - DO NOT modify the defaults. You can set your forms as default ones, but don't edit / remove the existing ones.

1
  • Thanks for advice, I was needed forms that would have custom logic, so SPD wasn't a good fit in this case, however I've overrided XMLDocument node, and set my custom application pages as Edit/View/Add forms for list.
    – Michael
    Dec 24, 2012 at 6:58
0

Try to set Inherit='FALSE' on your content type. XmlDocuments have a tendency to be ignored when they are set to inherit. Also, I'd be sure your content type is the default on the list so when you click 'Add new item', it is the content type selected.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.