none
Need to disable Mark complete button in PWA 2010 RRS feed

  • Question

  • Dear All

              I need to disable Mark complete button in PWA timesheet (highlighted above) thru PSI. Kindly help me for the same and i know just basics in PSI


    Thanks in advance

    Santhu

       

    Wednesday, February 29, 2012 4:48 PM

Answers

  • Hi Santhu,

    You can't disable the ribbon button using PSI. You'll have to create a feature to disable/hide the button using custom action in a XML files. With Custom action you can also use javascript to add conditional rules for activating/disabling the button.

    The ID property in the custom action tag is the id of the button you want to work with. For you the custom action you'll need to write is something like :

    <?xml version="1.0" encoding="utf-8"?>
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
      <CustomAction
        Id="RemoveMarkCompleteRibbonButton"
        Location="CommandUI.Ribbon"
        Title="Disable the Mark Complete button in the ribbon">
        <CommandUIExtension>
          <CommandUIDefinitions>
            <CommandUIDefinition Location="Ribbon.ContextualTabs.MyWork.Home.Tasks.MarkComplete">
            </CommandUIDefinition>
          </CommandUIDefinitions>
        </CommandUIExtension>
      </CustomAction>
    </Elements>

    To have more details on how to build the xml, you can have a look on the MS "How to" article : http://msdn.microsoft.com/en-us/library/gg549101.aspx#pj14_ModifyPWARibbon_TimesheetRibbon

    Hope it will help you.

    Clement.


    Wednesday, February 29, 2012 9:49 PM

All replies

  • Hi Santhu,

    You can't disable the ribbon button using PSI. You'll have to create a feature to disable/hide the button using custom action in a XML files. With Custom action you can also use javascript to add conditional rules for activating/disabling the button.

    The ID property in the custom action tag is the id of the button you want to work with. For you the custom action you'll need to write is something like :

    <?xml version="1.0" encoding="utf-8"?>
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
      <CustomAction
        Id="RemoveMarkCompleteRibbonButton"
        Location="CommandUI.Ribbon"
        Title="Disable the Mark Complete button in the ribbon">
        <CommandUIExtension>
          <CommandUIDefinitions>
            <CommandUIDefinition Location="Ribbon.ContextualTabs.MyWork.Home.Tasks.MarkComplete">
            </CommandUIDefinition>
          </CommandUIDefinitions>
        </CommandUIExtension>
      </CustomAction>
    </Elements>

    To have more details on how to build the xml, you can have a look on the MS "How to" article : http://msdn.microsoft.com/en-us/library/gg549101.aspx#pj14_ModifyPWARibbon_TimesheetRibbon

    Hope it will help you.

    Clement.


    Wednesday, February 29, 2012 9:49 PM
  • I have been asked to accomplish this same task but the code listed does not hide the button on Project Web App 2013. This is the workflow I have followed:

    Navigate to tasks page -> edit page -> Add a Script Editor Web Part -> paste the above code -> click save and refresh the task page.

    I think part of the problem is that this button does not get initialized/created until the user clicks on the tasks ribbon. Do you have any suggestions?

    Thursday, August 18, 2016 7:14 PM