Domanda

I have 2 SharePoint tasklists named Projects and Projecttasks. In Projecttasks i've created a Lookupfield which looks for the Title in Projects. Then, i created a new DispForm for Projects with an DVWP-Webpart, added a XSLTListViewer for Projecttasks and filtered the items with the lookup field. For now it works and if i open a Project-Listitem, i am able to see all tasks open for the project at the bottom of the Form.

What i want is to add an button or link in the DispForm of the Project-list, that opens a Projecttask-NewForm with the lookup-column "Project" autofilled from orginal Project-DispFrom where i clicked the "New Task" link or button.

I would prefer to get an solution in JavaScript, but ANY hint how i could fill the field or connect the forms be will be favored.

Thanks in advance! Mike

È stato utile?

Soluzione

Okay, this was not that hard as i expected.

  1. I created a custom newform in the 2nd tasklist.
  2. I created a custom "Add task"-Link to the New custom field in the 2nd list with a
    parameter which sends the listid of the item of the first list.
  3. I took the parameter from the custom link in the newform
  4. I autofilled the parameter in the lookupfield of the 2nd List and made the textfield readonly in javascript

This is only a generalized how-todo-do, beacause i think all the code i wrote is very likely to improve. If you're searching the web for the particular keywords mentioned above, you will be pretty easy autofill the field.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top