OPEN TO WORK

Available for new opportunities! Let's build something amazing together.

Quick Tip: Custom Action Tokens in SharePoint 2010 Designer

Custom Actions Ribbon SharePoint Designer
post

This post is over a year old, some of this information may be out of date.

SharePoint 2010 Designer allows you to create custom actions for the SharePoint ribbon or the item context menu.

Show image Custom Actions in SharePoint Designer
Custom Actions in SharePoint Designer

These custom actions can be used to start a workflow, navigate to a form, and navigate to a custom URL.

Show image Action Types
Action Types

For the last option you can make use of “Tokens”. These tokens enable you to create a variable URL’s.

The tokens that could be used are the following:

**Token** **Replaced With**
~site SPContext.Current.Web.ServerRelativeUrl
~sitecollection SPContext.Current.Site.ServerRelativeUrl
{ItemId} item.ID.ToString()
{ItemUrl} item.Url
{SiteUrl} web.Url
{ListId} list.ID.ToString("B")
{RecurrenceId} item.RecurrenceID

Examples

~site/ = /demo/CustomAction/SubSite/
~sitecollection/ = /demo/CustomAction/
{ItemId} = 2
{ItemUrl} = /demo/ CustomAction /Lists/Custom/2_.000
{SiteUrl} = http://jtb-sp2010elst2/demo/CustomAction
{ListId} = {59e393f7-3fc3-4408-86f9-6819bbdf6886}
{RecurrenceId} = Not tested

More information about the RecurrenceId can be found here.

Related articles

Report issues or make changes on GitHub

Found a typo or issue in this article? Visit the GitHub repository to make changes or submit a bug report.

Comments

Elio Struyf

Solutions Architect & Developer Expert

Loading...

Let's build together

Manage content in VS Code

Present from VS Code