I have two lists. One describing projects, one project per row with several columns. The other one is a slightly modified task list, with every task assigned to a project from the other list using lookup column. I already managed to implent a project dashboard as depicted here:
The lists connected via lookup columns are filtered automagically by using filter webpart and this ominous data receivers.
This solution has one major drawback. If you want to associate a task to a project, you have to select the numerical ID of the project, when editing the task. That is no problem, when dealing with 6 projects but with growing numbers it is very tedious.
I thought the simplest way to circumvent the resulting brain damage was to jump to the Tasks/NewForm.aspx from the project list by adding a customized action to the context menu and submitting the content of the lookup column via the query string.
To be on the safe side, I first tried to modify the query string manually (i.e. changing the url of the NewForm.aspx manually)
These are some of my tries:
https://<sitepath>/_layouts/15/start.aspx#/Lists/Tasks/NewForm.aspx?Task%20Name=testme&Source=https%3A%2F%2F<sitepath>%2FLists%2FTasks%2FAllItems%2Easpx&RootFolder= https://<sitepath>/_layouts/15/listform.aspx?PageType=8&ListId=%7B7AFEE88E%2D8CB2%2D4E04%2D8C27%2D939A4C99E272%7D&RootFolder= https://<sitepath>/Lists/Tasks/NewForm.aspx?RootFolder= https://<sitepath>/Lists/Tasks/NewForm.aspx?Project%20ID=6 https://<sitepath>/Lists/Tasks/NewForm.aspx?Task%20Name=aeiou https://<sitepath>/Lists/Tasks/NewForm.aspx?Description=aeiou
"Project ID" is the name of the lookup column. is the original path to the lists, which I shortened to keep it readable.
To make it short: Neither of my many tries came up with prefilled fields. Nor did I receive any error messages. I always got a blank form on my tries.
My current thoughts about the cause are
- I made a mistake with the query string syntax, like missing special characters, quotes or similar,
- This trick is somehow prevented by our sharepoint farm
Why doesn't my query string work? And if there's no solution, is there a different approach to let users link a task to a project without knowing every numerical Project ID?