Friday 30 March 2012

Binding Custom Action to Specific List Instance

In Elements.xml for custom action, use $ListId:Lists/xxx; as RgistrationId, replace xxx with the static name of your list. e.g.
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <CustomAction   Id="RibbonTest"
                Location="CommandUI.Ribbon"
                RegistrationId="$ListId:Lists/MyList;"
                RegistrationType="List"
                Sequence="1">
  
Please note that this approach only works in sandboxed solution, it doesn't work in a farm solution.