SharePoint Task List
-
13 April 2012 17:33
I created a task in SharePoint for a particular workspace at work (something similar to a list but I added more functionality). The tasks works perfectly and it opens in a new sharepoint window when a user click on an icon.
However, when the user clicks OK to submit the task, I want the page go back to the original workspace instead of opening a spreadsheet list in the background.
Is there a way to force the task to go back to the original site? I want to give the illusion to the user that they are entering data into a form and thus being recorded by SharePoint. I don't have the ability to connect directly to our SharePoint server using designer or to use workflow templates at this time. I only have access to the workspace to do my changes.
The task works perfectly, I just need to have it go back to the default page. Any ideas?
"There's a time and place for that. The time is... Never. You can figure out the place on your own".
Semua Balasan
-
16 April 2012 8:28
Hi esteban2800
There’re something need to be clarified. Are you using spreadsheet view in the task list? When you submit the task, the page will be redirected to the spreadsheet view which you don’t want it to do. You need the form to be submit and redirect the page to certain page you specified. If this is your requirement, you can accomplish it by following these steps:
- Add a Content Editor Web Part to the new task page(e.g.
http://hostname/Lists/Tasks/NewForm.aspx)
- Browse the new task page and add an additional QueryString toolpaneview=2 so that you can edit the new task page. Please refer to this article for more information.
- Add a Content Editor Web Part in this page, by which you can insert a JavaScript code snippet in to the shared view of this page.
- Add some JavaScript to the page, which will change the source parameter of the page, the page will be redirected to the source parameter Url when the form is submitted.
- Edit the Content Editor Web Part, click Source Editor and write JavaScript code like this:
<script type="text/javascript"> //Parse the query string of url var querystring = window.location.search.substring(1); var parameters = querystring.split("&"); var QueryString = Array(); for (var i=0;i<parameters.length;i++) { QueryString[parameters[i].split("=")[0]] = parameters[i].split("=")[1]; } //Check the WT query string flag to prevent from redirecting repeatedly if(QueryString["wt"]==undefined) { //replace the source parameter in the url. document.location.href = document.location.href.replace(/source=[^&]*/ig //specify the url you wanna redirect ,"source="+escape("http://lambda2007/default.aspx")+"&wt=1");// add the wt flag } </script>
Please read these link for more information:
http://techtrainingnotes.blogspot.com/2009/06/sharepoint-redirecting-to-page-after.html
Thanks,
Lambda Zhao
TechNet Community Support
- Add a Content Editor Web Part to the new task page(e.g.
http://hostname/Lists/Tasks/NewForm.aspx)
-
16 April 2012 13:48
You are semi-correct. It's a form masked in a task. For example, when a user clicks on a SharePoint link, it will open a list (in a view form) with questions. It's similar to a survey but I used task because it was the only way I could use the "Assigned To" reserve field. The task or form has 20 questions. Once the user completes the entire form, he or she will click OK and it directs them to their spreadsheet data. Well, I don't want it to direct them to their data. I just want it to simply go back to the main default page. I want to avoid the user getting confused and all of the sudden they will have a spreadsheet and not know where to go. If I direct them to the main page, then they won't get lost.
I will see if I can incorporate your java script.
"There's a time and place for that. The time is... Never. You can figure out the place on your own".