Click to Rate and Give Feedback
MSDN
MSDN Library
Web Development
Server Technologies
SDK Documentation
General Reference
Feature Schemas
 CustomAction Element
CustomAction Element (Custom Action)

Defines a single custom action for a link or toolbar item.

<CustomAction
  ContentTypeId = "Text"
  ControlAssembly = "Text"
  ControlClass = "Text"
  ControlSrc = "Text"
  Description = "Text"
  GroupId = "Text"
  Id = "Text"
  ImageUrl = "Text"
  Location = "Text"
  RegistrationId = "Text"
  RegistrationType = "Text"
  RequireSiteAdministrator = "TRUE" | "FALSE"
  Rights = "Text"
  Sequence = "Integer"
  ShowInLists = "TRUE" | "FALSE"
  ShowInReadOnlyContentTypes = "TRUE" | "FALSE"
  ShowInSealedContentTypes = "TRUE" | "FALSE"
  Title = "Text">
</CustomAction>
Attribute Description

ContentTypeId

Optional Text. Specifies the ID of a content type to associate with the custom action.

ControlAssembly

Optional Text. Specifies the assembly of a control that supports the custom action.

ControlClass

Optional Text. Specifies a control class that supports the custom action.

ControlSrc

Optional Text.

Description

Optional Text. Specifies a longer description for the action that is exposed as a tooltip or sub-description for the action.

GroupId

Optional Text. Identifies an action group that contains the action, for example, "SiteManagement". If contained within a custom action group, the value of the GroupId attribute must equal the group ID of the CustomActionGroup element.

See Default Custom Action Locations and IDs for a list of the default custom action group IDs that are used in Windows SharePoint Services.

Id

Optional Text. Specifies a unique identifier for the custom action. The ID may be a GUID, or it may be a unique term, for example, "HtmlViewer". See Default Custom Action Locations and IDs for a list of the default custom action IDs that are used in Windows SharePoint Services.

ImageUrl

Optional Text. Specifies a virtual server relative link to an image that presents an icon for the item.

Location

Optional Text. Specifies the location of this custom action, for example, "Microsoft.SharePoint.SiteSettings". If the custom action is a menu item or toolbar button, then the possible options include EditControlBlock, NewFormToolbar, DisplayFormToolbar, and EditFormToolbar.

If contained within a custom action group, the value of the Location attribute must equal the location of the CustomActionGroup element.

See Default Custom Action Locations and IDs for a list of the default custom action locations that are used in Windows SharePoint Services.

RegistrationId

Optional Text. Specifies the identifier of the list or item content type that this action is associated with, or the file type or programmatic identifier (ProgID).

RegistrationType

Optional Text. Specifies the registration attachment for a per-item action. Possible values include:

  • ContentType

  • FileType

  • List

  • ProgId

RequireSiteAdministrator

Optional Boolean. TRUE to specify that the item be displayed only if the user is a site administrator; otherwise, FALSE. Using the RequireSiteAdministrator attribute for the drop-down menu of Windows SharePoint Services commands associated with list items is not supported.

Rights

Optional Text. Specifies a set of rights that the user must have in order for the link to be visible, for example, "ViewListItems,ManageAlerts". If not specified, then the action always appears in the list of actions. To specify multiple rights, separate the values by using commas. The set of rights are grouped logically according to AND logic, which means that a user must have all the specified rights to see an action. For a list of possible values, see Microsoft.SharePoint.SPBasePermissions.

Sequence

Optional Integer. Specifies the ordering priority for actions.

ShowInReadOnlyContentTypes

Optional Boolean. TRUE if the custom action is only displayed for read-only content types on the page for managing content types. The default value is FALSE.

ShowInSealedContentTypes

Optional Boolean. TRUE if the custom action is only displayed for sealed content types on the page for managing content types. The default value is FALSE.

Title

Required Text. Specifies the end user description for this action.

Minimum: 1

Maximum: Unbounded

You can use the CustomAction element to add standard ASP.NET controls and user controls (for example, text boxes or option buttons) as custom actions in toolbars. However, you can only add controls instantiating menu items to the drop-down menus of toolbars; you cannot add Web Parts or arbitrary controls.

For an example of how this element is used, see Custom Action Definitions.

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content      
How To: Add A Print List Option      Sharepoint BUZZ ... Mikhail Dikov   |   Edit   |  

This page links to a code example that demonstrates using the CustomAction element: http://www.sharepointbuzz.com/index.php/2007/01/08/how-to-add-a-print-list-option/ .

This link goes to a page full of ads and many broken links on a site. Please don't waste our time and post meaningful links possibly to the original blog or site, not some advertisement scam site.

Tags What's this?: Add a tag
Flag as ContentBug
Use of ControlClass and ControlSrc in CustomAction      idbi ... Robert Yu   |   Edit   |  

I use this sample to add custom control in Toolbar, it does not show any errors, but dhows only MY ECB ITEM as title.

Is it possible to add user control at this menu.

<CustomAction
Id="UserInterfaceLightUp.ECBItemToolbar"
RegistrationType="List"
RegistrationId="101"
ControlClass="System.Web.UI.UserControl"
ControlSrc = "/_controltemplates/myTest.ascx"
Location="EditControlBlock"
Sequence="106"
Title="MY ECB ITEM">
<UrlAction Url="/_layouts/LightupHello.aspx?ECBItem"/>
</CustomAction>

-------

You cannot bring the parameter in UrlAction Url, you should find other way to pass parameter.

ContentTypeId Attribute invalid      Thomas Prentis   |   Edit   |  

The ContentTypeId attribute throws an error when registering a CustomAction element feature via STSADM. Use RegistrationId instead with RegistrationType="ContentType"

<CustomAction 
Id="MyTestActions.MyTestAction1"
RegistrationType="ContentType"
RegistrationId="0x0100DD47B0D8BB58458A8D894A16BDC2CA210100D4067570A1B9DB4B83806954FF25AF7D"
Location="EditControlBlock"
Title="My Test Action">
<UrlAction Url="/_layouts/TestAction1.aspx?ID={ItemId}&amp;ListID={ListId}"/>
</CustomAction>
Restrict to a specific list      Sok Chuan ... Noelle Mallory - MSFT   |   Edit   |  

What is the possible value of RegistrationId and RegistrationType? I am actually want to restrict the effect of my feature to a specific list.

[Noelle Mallory - MSFT] Please post questions to the MSDN Forums at http://forums.microsoft.com/msdn. You will likely get a quicker response through the forum than through the Community Content.

Tags What's this?: Add a tag
Flag as ContentBug
Creating Menu Item for a Specific List/Document Library Template      Michael Bollhoefer   |   Edit   |  
I have a blog post on this subject that talks about implementing a menu item that is specific to a custom list/document that the feature is also creating at http://sharepointinsight.com/blog/Lists/Posts/Post.aspx?ID=33. I hope this will help you. Also if you're having trouble getting the {ListId} token to work (you're getting an error stating that the list does not exist) check out this post which should help as well. http://sharepointinsight.com/blog/Lists/Posts/Post.aspx?ID=32
Context menu for .eml files in document library      PrashanthSpark   |   Edit   |  

I need to provide context menu for .eml files in document library in sharepoint 3.0

Does any one know ? pls guide friends...

Code:

<?xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<!-- Per Item Dropdown (ECB) Type="ECBItem"-->
<CustomAction
Id="EMLViewer.ECBItemToolbar"
RegistrationType="List"
RegistrationId="101"
ContentTypeId

Location="EditControlBlock"
Sequence="106"
ImageUrl="/_layouts/images/ICEML.GIF"
Title="EML Viewer">
<UrlAction Url="/_layouts/EMLViewer.aspx?SITEURL={SITEURL}&amp;ItemId={ItemId}&amp;ListId={ListId}"/>
</CustomAction>
</Elements>

Flag as ContentBug
Out-of-box CustomAction identifiers      method001   |   Edit   |