Thursday, March 21, 2013

Linking Directly To The New Form For Multiple Content Types


Hello!

This is my first official blog and I wanted to give a quick tutorial on how to link directly to the New Item Form as well as how to link to the New Item Form for multiple Content Types within your SharePoint 2010 List or Library.

Linking Directly to a New Item Form
(this will link directly to the default content type new form)

Http://intranet/lists/mylist/newform.aspx

Linking directly to a different content type new form:

Http://intranet/lists/mylist/newform.aspx?ContentTypeID=

To find your Content Type ID go to the

Site Actions→ Site Settings→ Galleries → Site Content Types → Copy the shortcut for the content type you need to link to → take everything after ctype= (until the apostrophe) → use that content type id in the above URL

javascript:GoToPage('\u002fus\u002fExample/_layouts/ManageContentType.aspx?ctype=0x00A7470EADF4194E2E9ED1031B61DA088403');

Another way I found to directly link to the form is to open the desired form then copy the shortcut then use that, except after you submit the item it does not know where to post back to so you are left with a blank webpage and every time you refresh the page it creates a new item. I would suggest using the above method instead of using the copied shortcut, but if you do you will need to send the user back somewhere.

You can do this to fix the issue with that method or to send the user to the desired location

Http://intranet/lists/mylist/newform.aspx?ContentTypeId=0x00A7470EADF4194E2E9ED1031B61DA088403&Source=DesiredURLHere

9 comments:

  1. Hi Dan, this worked very well to me Thanks. However, there's an issue for me. After I hit ok to submit the form, I got redirected to the content type settings page instead of allitems list. Any suggestion?

    ReplyDelete
    Replies
    1. Hi Calvin,

      I have not run into this issue personally, could you provide what your URL looks like? For one the projects I was working on I created a new item link for each content type I had for a particular list and it sends me back to the AllItems.aspx page. The above article was written under the assumption that Designer is disabled on the site, but to make sure that you have the correct Content Type ID I would get it from SharePoint Designer.

      1. Open your site in Designer
      2. Select Content Types
      3. Open the Content Type you are linking to
      4. Copy everything next to ID
      5. Use that in conjunction with your new item link

      Example URL:
      /us/askhr/Lists/HR Question/newform.aspx?ContentTypeID=0x01008BF969272778CE4DAB2F7AAA7BA9887E0005FBBAF9D8689C418FBB787738E178B5

      For my example:
      askhr = site name
      HR Question = List Name
      ContentTypeID= The ID of my Content Type

      Let me know if this works and good luck!

      Dan

      Delete
  2. Hi Dan,

    Is it possible to use a similar method to launch a Document Library Content Type, rather than list item/newform?

    Regards

    Kevin

    ReplyDelete
    Replies
    1. Hi Kevin,

      Apologies for the late response, it has been an insane month for me. Are you trying to just get the upload form to launch with your default content type from a link or are you trying to launch the upload form and then open a specific content type in your library? I have done this in the past so just let me know if you still need help and I can see if I can dig up the old project where I had to do this.

      If you already got it figured out that is fantastic and sorry again for the delayed response!

      Best Regards,
      Dan

      Delete
    2. Hi Dan,

      I'm trying to create similar to what you did, but instead to a list item to a document in a document library. Basically I have a document library with several templates and I want a link from the home page to a specific document template.

      Thank you!

      Delete
    3. Hi Franco, are you trying to link the user to create a new document from template or to the upload document dialog and then have the content type set based on what they selected? If you are trying to link the user to a specific new document template I think it can be done. If this is your scenario just let me know and I can whip together a quick POC and I'll share how I did it. Best Regards, Dan

      Delete
  3. Thanks 100x for this. It worked like a charm and relatively easy to implement.

    ReplyDelete
    Replies
    1. I am glad to hear that this helped! Thank you for reading my blog and the comment :)

      Delete