0

I am trying to add a custom action to Workflows group in Documents tab of a Custom List. Also, I am adding another action to the Edit Control Block of same list. Below is the code I am trying to add,

<CustomAction
Id="{D61E5C6A-88AF-4370-9D34-C1F8954F1C39}"
RegistrationType="List"
RegistrationId="10001"
ImageUrl="/_layouts/Images/formatmap16x16.png"
Location="EditControlBlock"
Sequence="100"
Title="Custom Action">
<UrlAction Url="http://www.google.com"/>
</CustomAction>

<CustomAction
Id="{D5FBFC13-59D2-4846-9326-E101C9E6BDB8}"
RegistrationType="List"
RegistrationId="10001"
Location="CommandUI.Ribbon.ListView"
Sequence="5"
Title="Custom Action">
<CommandUIExtension>
  <CommandUIDefinitions>
    <CommandUIDefinition
      Location="Ribbon.Documents.Workflow.Controls._children">
      <Button
        Id="{857E70AF-CD75-4e7d-A81B-2D54D2AC9C18}"
        ToolTipTitle="Custom Action"
        ToolTipDescription="Custom Action"
        Alt="Custom Action"
        Sequence="5"
        Command="OpenGoogle"
        Image32by32="/_layouts/images/availableworkflow.gif"
        Image16by16="/_layouts/images/availableworkflow.gif"
        LabelText="Custom Action"
        TemplateAlias="o1" />
    </CommandUIDefinition>
  </CommandUIDefinitions>
  <CommandUIHandlers>
    <CommandUIHandler Command="OpenGoogle" CommandAction="javascript:window.open('http://www.google.com')">     </CommandUIHandler>
  </CommandUIHandlers>
</CommandUIExtension>
 </CustomAction>

I can see the custom action in ECB of my custom list, but the custom action in Documents tab does not show up. The same code works if I set the RegistrationId = 101 for other document libraries. It also works if I change the Custom Action location to CommandUI.Ribbon.DisplayForm and the CommandUIDefinition to Ribbon.ListForm.Display.Actions.Controls._children and I can see custom action the Display form. But, I want it in the workflows group of Documents tab.

I don't understand what I am missing.

2
  • Try Location="CommandUI.Ribbon" instead of Location="CommandUI.Ribbon.ListView" Commented Apr 16, 2015 at 15:23
  • Tried that as well. Didn't work. Commented Apr 16, 2015 at 15:27

2 Answers 2

0

If you're using a custom content type in your custom list, an alternative way of registering the control is to set the registration type to ContentType and set the registration id to your custom content type id.

Otherwise, check that your list registration id of 10001 is correct.

1
  • I cannot use the content type, because the content type is used in other lists too. The registration id should be correct, because the custom action shows up in the ECB and Display form. Its just the Documents tab that does not display the custom action. Commented Apr 16, 2015 at 17:03
0

For my working button I have this XML at the top, some differences with yours, so hope it might help you:

<CustomAction Id="XXXXXXXXXXXXXXXXX"
            RegistrationType="List"
            RegistrationId="{$ListId:Lists/dlWerkinstructies;}"
            Location="CommandUI.Ribbon"
            Sequence="10001"
            Title="Invoke &apos;rbnStartWFRemoveWerkinstr&apos; action">

What's RegistrationID in your XML is the sequence in my XML.

4
  • I thought the RegistrationID of the custom action for a RegistrationType List should be the Template ID. I tried specifying the List Url in the RegistrationID as you did, still I don't see the custom action. Commented Apr 16, 2015 at 18:39
  • Are sure the tab is the DOCUMENTS tab and not the ITEMS tab? Commented Apr 16, 2015 at 19:14
  • I am trying to add the custom action to a document library. Commented Apr 16, 2015 at 19:19
  • Other difference with my button is that I don't have the TooltipTitle and TooltipDescription, try to remove those to see I that helps... Commented Apr 16, 2015 at 22:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.