Thursday, February 8, 2018

Always Open SharePoint 2013 Tasks in Edit Mode

  • Open the task list in SharePoint Designer and create a new List Form
  • In the Create New List Form window, set the Filename as “RedirectToEditForm”, the type as Display, and check “Set as the default for the selected type”. Also pick your Workflow Task content type.
  • Open the Form in Designer so that the code is displayed, then click the “Advanced Mode” button in the ribbon bar. This will open the entire page for edits. 
  • Insert the following javascript directly after the line <asp:Content ContentPlaceHolderId="PlaceHolderMain" runat="server"> (this is around line 15) 
  • <script type="text/javascript">
        <!--
        var origUrl = window.location.toString();
        var editUrl = origUrl.replace("RedirectToEditForm","EditForm");
        window.location = editUrl;
        //-->
    </script>
  • Save the form, accepting the change from the site definition

Now whenever someone opens a task, the EditForm is automatically displayed and only one click is needed to approve or reject the task

No comments:

Post a Comment