Sharepoint 2010 Forum

 
Home » Forum » Sharepoint 2010       Ask a questionRSS Feeds

Related lists and add new item

  Asked By: Greg Vaughan         Date: Aug 18, 2010      Category: Sharepoint 2010      Views: 3713
 

I have two related lists appearing side by side as webparts on a page. I can select a record in the first webpart and it successfully filters the records in the second webpart. Yay!

However, the Add New Item link below the related webpart launches the Add form, but doesn't prefill the appropriate value in the field that establishes the link to the parent list. Ideally, new records added via that link would prefill the parent key value for me, without having to select it.

Anyone know how to achieve this?

Tagged:            

 

3 Answers Found

 
Answer #1       Answered By: Greg Vaughan          Answered On: Aug 19, 2010       

www.endusersharepoint.com/.../

This post elsewhere is very helpful but there seems no way to edit the Add New Item url on the related  list's webpart  in Foundation 2010.

 
Answer #2       Answered By: Eric Fang          Answered On: Sep 06, 2010       

There is no easy way to resolve this issue.

I would recommend to do that through code. It needs a web part (as consumer) to accept web part connection and display the filtered data, and also provide a link which links to another web part page  with url parameter to add  new item.

In the web part page, a web part acquire the data from url parameter, and then put it into the dropdownlist control as default value.

This solution is far from good. However, to make the whole system flexible and easy to maintain, Microsoft had to keep the dependency among objects minimal, which caused this drawback.

 
Answer #3       Answered By: Corey Martin          Answered On: Jan 21, 2011       

This will solve it easily using JavaScript.

code.google.com/p/sp2010-related-list-prefill/

Let me know if it works and if you have any feedback! E-mail is on the site.

 
Didn't find what you were looking for? Find more on Related lists and add new item Or get search suggestion and latest updates.


Your Answer
  • Answer should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].