Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have a list called "Stage", which has an Task list with a filter in the Displayform:

enter image description here

If the user wants to add a new task to this specific item the newform for the Task appears. To be sure, the task is mapped to the right stage, we want to save the stage ID or Title as well. The question is now, how can I pass value from the detail view (i.e. Id and Title) via the URL by clicking on "Add new item" in the task list. Is this possible without programming in VS?

Thanks in advance

Jürgen

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Well either you have to drop the NewForm on the "Stage" item display page.. Or you should create your own custom "Add new item" button.. which takes Stage Item Id from Query String [ID] and send it to the popup/page of New Item form!

Once you have the Stage Id in Query String you can use jQuery to get the control and set its value:

$("select[title='ParentLookupField']")

You should simply follow:

Setting SharePoint Form Fields Using Query String Variables Without Using JavaScript
OR
Get or Set value for SharePoint field in NewForm, EditForm and DispForm (Get only in DispForm)

PS: Above example is using SharePoint 2007, but logic should be same!

share|improve this answer
    
Ah, a custom button... Why didn't I think of that? Good idea Arsalan :) –  Jürgen Stürmer Oct 1 '13 at 13:29
    
Coz I have done it before ;) –  Arsalan Adam Khatri Oct 1 '13 at 13:34

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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