How to execute code for custom menu action?
-
06-12-2019 - |
Question
I have a custom menu action, declared like this:
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<CustomAction
Id="ConvertListLevel"
Location="EditControlBlock"
Title="Convert to ListItem"
RegistrationType="ContentType"
RegistrationId="0x0120007475831FEECFBE4F8B93B41FAC8A2C7200CAEC6AD590466D419F5427BB7597F031">
</CustomAction>
</Elements>
Now I want to execute some code when the action is clicked. To be more clear, I need to copy a list item. What do I have to insert into the elements.xml to reach some code?
Thank you very much,
LMW
Solution
You need to specify the Url and pass tokens like ListID, ItemId etc in a child element called UrlAction as shown here:
http://hristopavlov.wordpress.com/2008/12/08/urlaction-tokens-of-the-customaction-feature/
and
http://www.manojn.com/blog/post/EditControlBlock-(ECB)-menu-item-in-SharePoint-Wiki-and-Blogs.aspx
Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange