0

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:

https://youtu.be/aiVIsAK9jkk

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?

  • See here for an example using JSLink: stackoverflow.com/questions/25161246/… or do a web search for "SharePoint new form query string values" for more examples. – Mike Smith - MCT - MVP Apr 30 '18 at 14:11
  • Hmm, I followed the instructions of the link. Now my NewForm is broken and I can't edit it anymore. What can I do? As from how it looks now, I have to delete the whole library and recreate it... – Ariser Apr 30 '18 at 16:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.