Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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?

share|improve this question
    
Try the solution given here –  Daniel Ziga Jan 26 '12 at 11:52

2 Answers 2

up vote 2 down vote accepted

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.

share|improve this answer

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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