Adding Custom Actions to the List Item Menu in SharePoint 2010 Using SharePoint Designer 2010[Sharepoint中添加自定义菜单]

转载 2011年01月18日 14:04:00


In SharePoint 2010, it is easier than ever to add custom actions that are scoped to a specific list using SharePoint Designer 2010. So today, I am going to walk you through the process.

In a related post on my blog , I showed you how to surface ULS logs using SharePoint Designer 2010, an External Content Type, and an External List. We’re going to use that list as our base for our custom action.

Our phony business case for this custom action is such – We are surfacing our ULS logs into a SharePoint list, and want to collect feedback on specific log entries for later consumption. We need to link to a form elsewhere in the site, which we will pass a reference to the item in question, as a URL.

Note – the List Item Menu refers to the same thing as the Edit Control Block. This is the context menu which is associated with all list items, available in list views and list view web parts.

So, let’s open SharePoint Designer 2010, and navigate to our ULS Logs list, and we’re going to select Custom Action > List Item Menu from the Custom Action button on the ribbon UI


Once we select that link, we are presented with the following form


We’re going to name our custom action Log Entry Comment , and give it a description as well. Now let’s scroll down. You will see that we have 3 different types of actions we can associate with this custom action…


We can

    • Navigate to a Form for this list
    • We can Initiate a Workflow
    • Or, we can Navigate to a URL

We’re going to select Navigate to URL , and enter in our URL, and enter in our bogus URL, and pass a name/value pair of ItemURL={ItemUrl}, which was found by looking into the November 2009 version of the SharePoint 2010 SDK


OH NO! We can’t use it in Beta 2, which is the public beta we are running! Ok, so I guess on the receiving end, we’ll need to fix it up in some other way. So, we’ll just change our URL to pass a few things, and build the URL ourselves.{SiteUrl}/Lists/ULS Logs/DispForm.aspx?ID={ItemId}

there, that should do the trick…

So, set your URL, and then give it a sequence number. This is the number in which it appears in the list. Anything over 10000 is a good practice, so you do not interfere with any other items in the list.


Then click OK , and you now have a custom action, associated with a list item, all without cracking open Visual Studio, deploying a package, etc. etc.

You will now see it on the ULS Logs list dashboard page in SharePoint Designer 2010


So, let’s go check out list… and there we have it, our custom action, associated to the list item menu/edit control block, within our list!


And if we click it, we get an ugly, url encoded version ( Logs/DispForm.aspx?ID=__cb40004300o4200b7983a57-53e7-de11-8ed4-000c29a9d0f1) of: Logs/DispForm.aspx?ID=__cb40004300o4200b7983a57-53e7-de11-8ed4-000c29a9d0f1

Another cool thing, which you may notice, is that ALL list items have a globally unique identifier in SharePoint 2010! YES! No more list item IDs starting with 1, and going up from there.

SharePoint 2013 workflow 开发 SharePoint Designer 2013 vs. Visual Studio 2012

SharePoint 2013 workflow 开发 SharePoint Designer 2013 vs. Visual Studio SharePoint 2013 支持两种主要的...
  • farawayplace613
  • farawayplace613
  • 2013年03月22日 17:21
  • 5388

一步步学习SPD2010--microsoft sharepoint designer 2010 step by step

最近在公司里学习G2流程工作引擎,需要用到SharePoint。因此想顺便先研究一下SharePoint Designer。 国内的文献以及书籍比较少,我只好看点国外的,找了这个《深入浅出学习微软S...
  • u012025054
  • u012025054
  • 2014年03月09日 22:09
  • 2346

SharePoint Designer2010 设计多级审批工作流。

用SPD设计无代码工作流比较简单实用,这里就来探讨一下如何用SPD设计以下流程的工作流。 要求:1.部门内部流程分为两级:办事员审批、部门经理审批。            2.如果审批不通过...
  • alfred_72
  • alfred_72
  • 2013年08月19日 10:45
  • 4207

SharePoint 2010开发环境搭建

本文的主要内容:本地电脑上搭建SharePoint 2010的开发环境,资料来源主要是翻译微软官方文档,以此记录学习过程,下面就一步一步翻译重点,由于我电脑是Win 7系统,所以这里主要介绍windo...
  • liu1137537275
  • liu1137537275
  • 2016年05月07日 02:19
  • 4819

sharepoint list权限 (二)

public override void ItemAdded(SPItemEventProperties properties) { //用此方法模拟管理员账户...
  • jason_dct
  • jason_dct
  • 2013年06月04日 10:10
  • 1589

SharePoint 2010/2013 通过List Item的内容菜单(BCD)来拷贝Item

本文讲述SharePoint 2010/2013 通过List Item的内容菜单(BCD)来拷贝Item的方案。
  • farawayplace613
  • farawayplace613
  • 2014年03月09日 10:12
  • 1783

在SharePoint管理中心管理SharePoint Designer设置

在SharePoint管理中心管理SharePoint Designer设置
  • u012025054
  • u012025054
  • 2014年06月29日 11:37
  • 1609

sharepoint 2010 自定义页面布局

在sharepoint开发中经常遇到 自定义网站栏、内容类型,页面布局和模板页也会遇到,遇到机会就相对比较小。 首先新建一个空的sharepoint项目: 1)创建网站兰: 修改SiteColumn...
  • dz45693
  • dz45693
  • 2014年01月06日 23:04
  • 2570

sharepoint 2010 所有list新建按钮消失和管理员权限丢失的解决方法

故障描述:     早上上班所有表单不能新建项目,系统管理员也不行。而且系统的很多权限消失了。财务、人力、行政、销售等等均不能使用,电话爆了。       初步判断是权限问题,从OA--到管理中心...
  • jason_dct
  • jason_dct
  • 2013年07月09日 18:11
  • 1290


由于我的这个SearchPhotos.aspx页面使用了WSS的application.master作为母版页,因此无法直接在aspx页面里面用标签指定要使用的CSS文件。 只能在aspx页面...
  • strive2008
  • strive2008
  • 2010年10月11日 10:08
  • 829
您举报文章:Adding Custom Actions to the List Item Menu in SharePoint 2010 Using SharePoint Designer 2010[Sharepoint中添加自定义菜单]