1

I have 2 lists:

Users

Notes

Notes has a lookup field that links it to Users (ContactName)

I have added a Notes WebPart to User's Edit Item screen. Now when you edit a user, it shows a list of notes where their name is linked, and an 'Add new item' button.

When I click 'Add new item', the 'Notes - New Items' popup appears. One of the fields on the form is 'ContactName', a dropdown list of Users.

Considering I am currently editing a User, I would expect that user to be pre-selected in the dropdown list. However it is not.

Can anyone explain why it is not pre-selected, and how I can change it to pre-select the current user.

2 Answers 2

2

To accomplish that, you'd need to have some code that dynamically sends a query string prameter over to the newform page of the Notes list. The newform page would have some code on it that parses the query string and sets the desired drop down list value depending on who the user is.

Typically those associations have to be built, SharePoint doesn't do that for you, as obvious as that may appear when using other web sites. You could use jQuery and SPServices to handle some of this, SPServices has a dead simple to use query string parameter parser in it.

1
  • So I can use jQuery to get the current item's ContactName somehow (not sure yet), append it to the QS of the 'Add new item' link, and then retrieve it on the New Item page, and pre-select the name from the dropdown. I'll see how it goes. Thanks Jul 26, 2011 at 9:07
1

I've found exactly what I was after here. I followed the tutorial and everything works great.

http://geekswithblogs.net/SoYouKnow/archive/2010/12/16/creating-a-sharepoint-parentchild-list-relationshipndash-sharepoint-2010-edition.aspx

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.