CustomAction


Table of Contents

The CustomAction element is used to add links to menus throughout SharePoints user interface. This includes adding links to locations such as the site settings pages, or to the list menu toolbars. A detailed list of attributes can be found on MSDN at http://msdn.microsoft.com/en-us/library/ms460194.aspx.

To specify the location that the custom action should point to, the CustomAction element has a child element 'UrlAction'. The UrlAction element has only one attribute 'Url' which is where the URL that the CustomAction will point to.

A list of custom action locations that can be used with the custom action element to describe where the feature will add the link can be found on MSDN at http://msdn.microsoft.com/en-us/library/bb802730.aspx. Additionally there are the following undocumented locations and ID's.

Location Custom Action ID Group Description
Office.Server.ServiceProvider.Administration UAP User Profiles and My Sites
Office.Server.ServiceProvider.Administration Search Search
Office.Server.ServiceProvider.Administration ExcelServer Excel Services Settings
Office.Server.ServiceProvider.Administration PortalAnalytics Office SharePoint Usage Reporting
Office.Server.ServiceProvider.Administration BDC Business Data Catalog
Office.Server.ServiceProvider.Administration AUD Audiences
Microsoft.SharePoint.Administration.Operations ContentDeployment Content Deployment

Sample code


 An example of a complete CustomAction

<CustomAction Id="MyDeletedItems"
	 GroupId="SiteCollectionAdmin"
	 Location="Microsoft.SharePoint.SiteSettings"
	 Sequence="10"
	 Title="My example page"
	 Rights="ManageWeb,BrowseUserInfo">

	<UrlAction Url="_layouts/myexamplepage.aspx" />

</CustomAction>

Adding to ECB (Edit Control Block)

<CustomAction
	Id="CustomEditItem"
	RegistrationType="List"
	RegistrationId="107"
	ImageUrl="/_layouts/images/GORTL.GIF"
	Location="EditControlBlock"
	Sequence="1000"
	Title="Request Peer Reviews"
	Rights="EditListItems">

	<UrlAction Url="/_layouts/CustomEdit.aspx?ID={ItemId}&List={ListId}"/>

</CustomAction>

Adding actions to lists

When the RegistrationType="List" you will need to specify the correct ListTemplate id (i.e. 100 for a generic list, 101 for a document library, 102 for a survey etc). Custom ListTemplate id's can be used. 

External References

Labels

toolbars toolbars Delete
links links Delete
features features Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.


  1. Dec 16, 2008

    Rich Finn says:

    Here's a link to John Holliday's list of SharePoint's installed CustomAction Ide...

    Here's a link to John Holliday's list of SharePoint's installed CustomAction Identifiers.  I use this list when I want to HIDE a CustomAction that's already there, for example, removing the Create Site link in the Site Actions menu because we've got a custom provisioning process.

  2. Jan 07, 2009

    Anonymous says:

    Looks like this is stripped straight from MSDN; http://msdn.microsoft.com/en-us/...

    Looks like this is stripped straight from MSDN; http://msdn.microsoft.com/en-us/library/bb802730.aspx

    1. Jan 08, 2009

      Brian Farnhill says:

      I used the MSDN stuff as a starting point, but brought a few bits from MSDN toge...

      I used the MSDN stuff as a starting point, but brought a few bits from MSDN together on one page, and I also extended the locations table to include the "Office.Server.ServiceProvider.Administration" (Shared Service Provider) that isn't documented on MSDN. This way everything to do with the CustomAction element was on one page, and it could be used as a starting point to further conversation and info on how to use it.

  3. Feb 17, 2009

    Anonymous says:

    Do anybody have an idea what is the custom action ID for "Incoming e-mail Settin...

    Do anybody have an idea what is the custom action ID for "Incoming e-mail Settings" link that appears under "Commuincations" of list/Library settings ? I googled for a long time byt was not able to find the custom action ID for this element? Is there one exists or not I am not sure.

  4. Apr 25, 2009

    Paul Shkurikhin says:

    You can find some additional undocumented central administration activities...

    You can find some additional undocumented central administration activities here:

    http://blog.sharepointalist.com/2009/03/moss-central-admin-application-pages-p1.html

  5. Aug 06, 2009

    Anonymous says:

    SAFARI Browser...Please help!! Below works for IE and firefox but for sa...

    SAFARI Browser...Please help!! Below works for IE and firefox but for safari for windows the 2nd query string value will not work because safari renders the &amp as "&" instead of "&" I tried using &#38 but this dis not work either....Any ideas?

     <UrlAction Url="~site/_layouts/SpecialActionsXY/MySpecialActionXY.aspx?List=

    Unknown macro: {ListId}

    &ID=

    Unknown macro: {ItemId}

    "/>  

    Thanks.

    1. Oct 30, 2009

      Anonymous says:

      Did you get any solution for the above question? If yes, please let me know. Th...

      Did you get any solution for the above question? If yes, please let me know.

      Thanks & Regards,


Creative Commons License
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License. Hosted generously by CustomWare