4

I am having four external list "List1", "List2", "List3", "List4". I have added a custom ribbon button Like:

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <CustomAction
    Id="ATEAgWorkOrderButton"
    RegistrationType="List"
    RegistrationId="600"
    Location="CommandUI.Ribbon">
    <CommandUIExtension>
      <CommandUIDefinitions>
        <CommandUIDefinition
         Location="Ribbon.ListItem.Actions.Controls._children">
          <Button
           Id="Ribbon.ListItem.Actions.ATEAgWorkOrderButton"
           Alt="Click on this button to Add"
           Sequence="3"
           Image32by32="/_layouts/Images/Project/image.png"
           Command="ATEAg_WorkOrder"
           LabelText="Add Detail"
           TemplateAlias="o2"/>
        </CommandUIDefinition>
      </CommandUIDefinitions>
      <CommandUIHandlers>
        <CommandUIHandler
         Command="ATEAg_WorkOrder"
         CommandAction="javascript:alert("Hello Success");" />
      </CommandUIHandlers>
    </CommandUIExtension>
  </CustomAction>
</Elements>

The button is now visible in all the external lists. But I want to make it visible for only "List1" and "List2". How to do this?Can anyone help?

1

2 Answers 2

2

If you just want to add the ribbon button for those two lists (instances) the easiest thing to do is just add the ribbon buttons to the forms for those lists in SPD as shown here

But if what you are wanting to do is automatically add the button to every instance of List1 and List2, that is more complicated. If that is the case, please update your question to be more specific.

1

If you want to achieve this, then your custom lists need to have template ID's defined (assuming you are creating lists using list instances in VS 2010)

RegistrationId="YOUR TEMPLATE ID"

Group all your required lists with same template ID !!!! & check

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.