cancel
Showing results for 
Search instead for 
Did you mean: 
Workflow Hero

Workflow Task list to be in Edit mode as default

Jump to solution

I had testing with customer and most of parts of our solution works except this.

  • Customer wants the Workflow Task list must be in Edit Mode as default.





  • I told the customer, users can still edit by clicking on ellipses as shown:



    • Customer said that its TOO many clicks for the users and asked to change the behavior.

  • I created a new workflow on the Workflow Task list.



  • I had simple three actions Workflow.I created a Regular expressions action to replace Display to Edit form and store in a variable.




  • This are my configuration steps for regular expressions action:



  • In the Update List Item action, I update the task name and pass my variable as follows:




    and in Fx button, I chose URL format.



  • Somehow, Workflow Task is NOT creating items the automatically which I have already defined the Start Option but I will find a way for this.

  • After I click it manually, I am able to update the Display mode to Edit mode in the Task name as follows:




  • But when form is opened, it still shows as Display mode.




  • I have seen Swetha’s blog about the similar to my case but she show updates Edit form in Assign task which I had done it.  My case is a bit different.

    Any suggestions what am I doing incorrectly?
    Thanks in advance.
     
Labels: (2)
0 Kudos
Reply
3 Replies
Workflow Hero

Re: Workflow Task list to be in Edit mode as default

Jump to solution

Hi All,

I did some further research and added the workflow to my custom list that I have developed for this solution. It looks, we cannot add start options for items automatically for default SharePoint lists such as calendar, workflow tasks during my testing.

Here is my attempt to make Workflow Tasks to open in edit mode but I was unsuccessful:

  • Create a new test workflow called: Display to Edit WF.



  • Here are my all workflow actions:


  • Query List action: Create a local variable called: IDasNumber


  • Do Calculation action: increased ID by 1 





  • Build String: Constructed Current Site URL with List/workflow task and EditForm.aspx with ID. Created one more variable called TaskEditURL as follows:  



  • Update List Item: Update the Task Name with my TaskEditURL variable:


  • Log to History List: Logged both the variables: IDasNumber and TaskEditURL




  • Created new form with all required fields. In the Workflow Status , item ID is displayed (-----0017180) and in workflow history, I am able to click the Task Edit URL



  • The form opens in the Edit Form



  • When I navigated the Task Name column in the Workflow Tasks list and clicks on the ---0017180



  • The form is shown as View mode.


    Although I have updated list item in the workflow as shown:




  • In view, Task Name is linked to edit menu




    Can somebody suggest, what is incorrect in my workflow and is it possible to make Workflow Task to be make it editable mode as default?

    Any recommendations would be highly appreciated.

    Thanks  in advance.
0 Kudos
Reply
Workflow Hero

Re: Workflow Task list to be in Edit mode as default

Jump to solution

‌ ...any suggestions? 

0 Kudos
Reply
Workflow Hero

Re: Workflow Task list to be in Edit mode as default

Jump to solution

Running a workflow to modify the tasks themselves might not be the best solution here. A quicker option that I found to work would be to add a code snippet to the Workflow Task List page to update the links to reference the form edit page as opposed to the form display page.

Go to your workflow task list and click the cog wheel, then 'Edit Page'

Click 'Add a Web Part'

Go to the 'Media and Content' Section and select 'Script Editor' then click 'Add'

From there, click edit snippet within the Web Part

Insert the code snippet below:

<script type="text/javascript" src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
<script type="text/javascript">
$(document).ready(function()
{
  $('.ms-vb a[href*="listform.aspx"]').each(function(){
      var formurl = $(this).attr('href');
      formurl = formurl.replace("PageType=4", "PageType=6");
      $(this).attr('href', formurl);
  });
});
</script>‍‍‍‍‍‍‍‍‍‍‍‍

Click 'Stop Editing' on the page and try opening your task forms. They should be directed to the edit version now!

Reply