Sharepoint 2010 Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint 2010       RSS Feeds

Related lists and add new item

  Asked By: Greg    Date: Aug 18    Category: Sharepoint 2010    Views: 12778

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?



5 Answers Found

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


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

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

This will solve it easily using JavaScript.


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

Answer #4    Answered By: Chris Lee     Answered On: Oct 14

There is a solution you can download that will auto set and hide the parent item lookup column from children item forms, also gives a nice display of related content in a tabular format


Hope that helps someone else!

Answer #5    Answered By: Nick Johnson     Answered On: Oct 18

Did you try to resolve it through java script as mentioned above????
If yes then please write your experience, I want to try the same....

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