.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Custom Action help!

Posted By:      Posted Date: September 29, 2010    Points: 0   Category :SharePoint


We had a custom feature in SP 2007, that deployed a Custom Menu item on the List Actions menu in SP 2007. If I were to achieve same in SP 2010, via a button, what would be my code in terms of SPRibbon? I still want to use the control class, to initiate the custom button after the feature is activated. How can I achive this?

The Custom Action XML:





View Complete Post

More Related Resource Links

Custom Ribbon action using quick step for workflow

I created custom button using the quick step in ribbon, and configured to invoke a workflow. It shows start and stop page of workflow where I have to click start. How to start workflow directly from the ribbon without this redirection to page.  

List item custom action with custom url

Hello, Is it possible to create a listitem custom action with an url that contains {fieldname} instead of  {ItemId}, {ItemUrl}, {ListId}, {SiteUrl}, for example http://MYSPSITEURL/SitePages/custompage.aspx?Field=} ? {Title  

Is there a way to conditionally enable/disable a custom action

I've created a custom action that kicks off a workflow on an item in a list.  I want the workflow to be initiated only once.  So, once it is kicked off the first time, I'd like the custom action to be disabled so others cannot start it again. Is there a way to do this in Sharepoint Designer?

How to include a javascript file in a custom action?

I need to call a custom javascript function from a ribbon button, how do I include the javascript file within the custom action solution in order that it will be properly referenced by the html output? I am not allowed to define a custom masterpage at this point. So what can I do?   Thanks, Stephan  

When a Task Expired step in a Start Custom Task Process action is not fired?!

When a Task Expired step is not fired?! I created a simple Workflow using the SharePoint Designer. Added one step to which I added the Start Custom Task Process and set the Due Date "2 minutes after now". For the When a task Expired step of the custom Task I added a Log to History List action, which doesn't seems to be fired. What good be wrong??? All the steps I did to create the workflow: Started SP Designer 2010 and created a reusalbe WF. Added Start Custom Task Process action to step 1. Changed the behavior of the When a task Expired stepof the custom task (added a Log to History List action). Changed the behavior of the Before Task is Assigned by adding a Set Field action which set the Due Date of the task to "Now + 2 minutes". Published the WF and started the WF for a simple list item. Unfortunately the Log to History List actionof the When a task Expired step is never called.

Problem with custom workflow action (SP2010, SPD2010)

We have created an assembly containing 3 custom actions to be used in SPD. Everything works correctly; however every Change and Publish cycle requires me to recreate the lines (steps) containing the custom actions. It is simple mechanical replacement but still is a pain and i would like to figure this out. I've spent considerable time on this already with no solution in sight. Tried clearing out proxy cache (http://social.msdn.microsoft.com/Forums/en-US/sharepointworkflow/thread/34632798-6e45-4eb3-ad3d-2f941c706cda ) Also checked web.config for non-referenced assemblies.  

Custom Action help!

  Question: Hi, we had a Custom List Context menu Item in "Actions menu" in SP 2007. and below is the class we used for that. Now if I would like to use the same code for SP 2010, then What will be my eqquivalent Code with SP Ribbon. For your Reference I am also including the Custom Action XML that we used in 2007. Basically, this code used to Create a menu item on the "Actions Menu" of either a document Library or any type of list. So, I am looking for a Button on the List Tab, that appears on all List Views for list and all Views of Document Library. When a user Clicks on that Button then the user is directed to a URL mentioned in the Code below. Let me know if it is not clear or need more info. Custom Action XML: <CustomAction Id="SomeCustom.Action" Location="Microsoft.SharePoint.StandardMenu" GroupId="ActionsMenu" Sequence="20" ControlAssembly="Some Key" ControlClass="Class mentioned below" /> Class Referenced in Above CustomXML using System; using System.Collections.Generic; using System.Text; using System.Web.UI; using System.Web.UI.WebControls; using Microsoft.SharePoint; using Microsoft.SharePoint.WebPartPages; using Microsoft.SharePoint.WebControls; namespace MyNameSpace { public class MyClass : WebControl { protected override void OnLoad(EventArgs e) { En

Custom action on click of certain type of folders in a lsharepoint list


We have a Moss 2007 set up and we are trying to have the ability where in we have some folders in a list marked as "confidential"., and when the user clicks on these folder, we want to pop up a disclaimer dialog to the user, and force the user to accept or reject it.

Also we want the ability to throw this popup when the user is directly navigatinig to a certain file that resides in the folder.

Any suggestions would be greatly appreciated.



Custom Action for specific External Content Type List


I have an External Content Type list instance feature in Visual Studio. Deploying the instance works fine. However, I can't create a custom action using RegistrationId="{$ListId:Lists/yourlistname;}" RegistrationType="List"

Even if I specify the list Id as follows RegistrationId="{8F595340-5D08-4287-8BF6-30D50989D2F4}" or RegistrationId="8F595340-5D08-4287-8BF6-30D50989D2F4" I get nothing.

However, RegistrationId="600" works fine, but for all External Content Type lists.

I added the custom action with SharePoint Designer and it works as expected. When I generate a site template and import it into Visual Studio, the custom action uses RegistrationId="{$ListId:Lists/yourlistname;}" RegistrationType="List"

Creating a new site based on the site template creates the custom action correctly. However, deploying just the custom action does not work (feature deploys, but no custom action appears). I also tried RegistrationId="0x0100D67E541CC4BB6A4A9D62D22657ECFF68" RegistrationType="ContentType" with no luck. The content type id was pulled from the list instance using the object model.

I have to tie the custom action to a specific list instance. Because the li

Cant read registry during custom action

I have built an installer project that uses a custom action that fires during the AfterInstall event.  I am having a strange problem with this code in Windows 7 64 bit that I am not having under Vista 32 bit.  The problem is that in the 64 bit version, a particular registry key that I need to read is showing up as not having any values, even though it definitely contains over 30 values.  Opening the key does not throw an exception - it just doesn't appear to contain any values.  If I execute my code from an EXE and execute it in Windows 7 64 bit, it does not have this problem - the problem only occurs when I call the code from within the context of the custom action and the custom action works fine on 32 bit vista.  The registry key that I am reading ALREADY EXISTS on the machine - my installer is not creating any keys.  I am totally stumped on this one.  Anybody have an idea about what might be going on here?  Thanks in advance for any suggestions or ideas.


Custom workflow action - send an email with blind carbon copy

Question: Is there any way that we can send an email with blind carbon copy (BCC) option? I know this feature is unavailable in the custom workflow action (in SPD-2007) but there is a requirement where I need to send an email without revealing other ids of other recipients. 

how to show site action menu on custom master page??


i have created my own custom master page and trying to show "site action" menu on my master page

how is this posible,what modifications are needed in .master file  to do this

 in sharepoint 2010


How to add a custom action (a link) to Central Administration quick launch in sharepoint 2010 ?


Hello everyone,
How can I add a link to Central administration quick launch? There are several links in Central administration quick launch by default under "Central administration" text ("System settings", "Monitoring", "Backup and Restore", "Security", "Upgrade and Migration", "General Application Settings", "Application Management", "Configuration Wizards"). How can I add new link under "Configuration Wizards". And I tried  but it doesn't work. A link appeared on the Central administration page but it isn't displayed at the quick launch (left panel) .
I did that as follows:


<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
       Title="Test Menu Quick Link"

Custom Form Field in Collect Data Action doesnot capture multiple users.


I have a situation where the department head dynamically assigns the reviewers depending on the document that is uploaded. To capture the reviewers I added a Collect Data Action and a "Reviewers" form field, with type "Person/Group" and checked the following properties

1. Allow selection od People and Groups, 2. Choose from all users and more importantly 3. Allow multiple users

Although I am able to enter multiple users in the form, I am able to retrieve only the first user I entered and the rest just.. disappear!

How to hide/remove "Alert Me" action menu item from Custom List/Document Library?


Hi All,


I am using Sharepoint 2007 (MOSS).

I want to hide/remove "Alert Me" action menu item from Custom List/Document Library for my Sharepoint site.


any help will be appreciated.



Using SQL scripts from a enbedded resource in a custom action


I setup a Custom action that connects and creates a database on the sever. I wanted to use SQL scripts to do this with. The problem is that I added the scripts to a folder off the installer1 project and and it keeps trying to find the sql scripts in the c:\windows\system32 folder.. Then I tried to add them as a Embedded resource and well it keeps erroring out saying 'Error 1001: illegal characters in path'

Any one have any ideas on how to get this to work right, Some of my code it below. from the custom action

string SQLConn = "Data Source=(local)\\SQLEXPRESS;Initial Catelog=master;Intergraded Security=SSPI";
      FileInfo file = new FileInfo(Resource.CreateDataBase);
      //FileInfo file = new FileInfo(@"SQLScripts\CreateDataBase.sql");
      string script = file.OpenText().ReadToEnd();

      SqlConnection conn = new SqlConnection(SQLConn);
        Server server = new Server(new ServerConnection(conn));

Using a Custom Action to Create a Database at Installation

Hi, I am using Custom DB Instalation By using Installar Class and Sql.txt, When I execute Bulk Stored Procedure Script I am Getting Error, Incorrect Syntax near Set, Can any one help How to Execute Stored procedure
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend