locked
Prevent reassignment of workflow task in Visual Studio RRS feed

  • Question

  • In SharePoint Designer, there is an option that you can de-select called 'Reassignment'.  How do I do the same in a Visual Studio 2010 state-machine workflow?

    Thanks,


    • Edited by Muggers Friday, May 2, 2014 5:02 PM updated which version of SharePoint
    Friday, May 2, 2014 4:58 PM

Answers

  • We will be going away from workflows altogether now (requirements changed yesterday), so I won't be able to provide a more detailed solution.  If we were going to continue with workflows though, I would:

    1) Use an aspx form instead of an InfoPath form as you have control over css

    2) Include jquery in your masterpage:

    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>

    3) Use jquery to dynamically set 'display:none' on the class 'ms-toolbar'.  Something like:

    $(".ms-toolbar").css("display", "none");

     Note that you could set the 'display:none' in the css file directly, but this would affect all pages where elements have the same class.

     

    • Proposed as answer by Hemendra Agrawal Thursday, May 22, 2014 4:32 AM
    • Marked as answer by JasonGuo Sunday, May 25, 2014 11:26 AM
    Wednesday, May 21, 2014 5:13 PM

All replies

  • Hi Muggers,

    According to your description, my understanding is that you want to prevent the task reassignment in state machine workflow.

    I recommend to create a custom form for the state machine workflow without the task reassignment button.

    More references about creating custom forms for state machine workflow:

    http://www.microsofttechnology.net/2012/03/sharepoint-2010-state-machine-workflows_25.html

    http://www.codeproject.com/Articles/501579/SharePoint-State-Machine-Workflows-with-Cus

    Thanks,

    Victoria

    Forum Support

    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.


    Victoria Xia
    TechNet Community Support

    Monday, May 5, 2014 3:05 AM
  • Hi Victoria,

    Thanks for responding, but I don't think that this is correct.  I have already created my own custom InfoPath form that doesn't include anything related to re-assignment of a task.

    In my State Machine workflow code, I have assigned the task to a SharePoint group:

                        this.retentionTaskProperties.AssignedTo  = @"Retention Managers";

    When the task is opened there is a 'Claim Task' button at the top of the form.  Do you know how to prevent this button from showing?  I know there are probably a myriad of ways to hide it using javascript and CSS, but I want to do it in my visual studio solution.

    I don't care who completes the task as long as they are in the 'Retention Managers' SharePoint group. 

    Thanks,

     

     

    Thursday, May 8, 2014 4:25 PM
  • Hello,

    I think you are assigning task to group that's why this option is visible. I am not sure how you can hide or disable it but you can try with "Task Changed Event" to control it. (This calls when you use claim and release task).


    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

    • Marked as answer by JasonGuo Sunday, May 18, 2014 10:14 AM
    • Unmarked as answer by Muggers Tuesday, May 20, 2014 10:02 PM
    Tuesday, May 13, 2014 11:43 AM
  • Thanks Hemendra,

      Yes, I am aware of why the button is showing up, but unfortunately I need to assign it to a group as the group members may change frequently over time.  Since there doesn't seem to be a way to do this using a visual studio workflow, I will use javascript and css instead.

    Paul

    Tuesday, May 20, 2014 10:07 PM
  • Hello Paul,

    Thanks for answer. Please share your solution with us so it can help other too.


    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

    Wednesday, May 21, 2014 4:51 AM
  • We will be going away from workflows altogether now (requirements changed yesterday), so I won't be able to provide a more detailed solution.  If we were going to continue with workflows though, I would:

    1) Use an aspx form instead of an InfoPath form as you have control over css

    2) Include jquery in your masterpage:

    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>

    3) Use jquery to dynamically set 'display:none' on the class 'ms-toolbar'.  Something like:

    $(".ms-toolbar").css("display", "none");

     Note that you could set the 'display:none' in the css file directly, but this would affect all pages where elements have the same class.

     

    • Proposed as answer by Hemendra Agrawal Thursday, May 22, 2014 4:32 AM
    • Marked as answer by JasonGuo Sunday, May 25, 2014 11:26 AM
    Wednesday, May 21, 2014 5:13 PM