1

I have a Pages library in which I want to place the custom action to start workflow on the page. The action simply redirects to the initiation form of workflow.

My XML code for custom action is as per below:

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <CustomAction Id="D7D4B708-783C-4221-8798-6A465C614B57.StartWfs"
               RegistrationId="0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF39"
               RegistrationType="ContentType"
               Location="CommandUI.Ribbon"
               Title="Start workflow"
               Description=""
               Sequence="1000">
    <CommandUIExtension>
      <CommandUIDefinitions>      
        <CommandUIDefinition Location="Ribbon.PublishTab.Workflow.Controls._children">
          <Button Id="Lofbergs.DocsStartWFEditMode"
                  Image16by16="/_layouts/15/Enhancement/Images/Approval_16_by_16.jpg"
                  Image32by32="/_layouts/15/Enhancement/Images/Approval_32_by_32.jpg"
                  LabelText=""
                  Command="DocsStartWFEditMode"
                  Sequence="10000"
                  TemplateAlias="o2"/>
        </CommandUIDefinition>
      </CommandUIDefinitions>
      <CommandUIHandlers>        
        <CommandUIHandler Command="DocsStartWFEditMode" CommandAction="javascript:function StartWorkflow()
                          {
                            var url = _spPageContextInfo.webAbsoluteUrl + '/_layouts/15/Enhancement/Pages/StartWorkflow.aspx?itemId={SelectedItemId}&amp;listId={ListId}&amp;Source={Source}';
                            window.location.href = url;
                          }
                          StartWorkflow();">
        </CommandUIHandler>
      </CommandUIHandlers>
    </CommandUIExtension>
  </CustomAction>
</Elements>

However, I am not getting the custom action displayed in the PUBLISH tab of the page. What am I missing?

Below is the image which illustrates the place where I want to show my custom action:

The custom action to be displayed

  • Does Location = Ribbon.Documents.Workflow.Controls._children work? – Nadeem Yousuf Dec 8 '14 at 7:21
  • 1
    yes sir, it is working. But I want to display the custom action when the page in pages library is opened. The Ribbon.Documents.Workflow.Controls._children comes in the picture when we want to apply in the view of the document library as per my knowledge. – users1100 Dec 8 '14 at 7:24
  • I have updated my question which shows the place where I want to display my custom action. – users1100 Dec 8 '14 at 7:25
  • Is ResitrationId correct. Can you try using RegistrationId="0x01" and see if it works for item content type – Nadeem Yousuf Dec 8 '14 at 7:50
  • Thank you for response sir, actually the thing is that, I am deploying the same definition to two places among them first is: Ribbon.Documents.Workflow.Controls._children and the second is: Ribbon.PublishTab.Workflow.Controls._children. When I activate the feature of the custom action, I am able to see the action at location: Ribbon.Documents.Workflow.Controls._children but not at the location mentioned above. – users1100 Dec 8 '14 at 8:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.