2

I've created a Sharepoint context menu custom action and I want to display the it when the feature is activated.

how can i do this ?

Code:

<CustomAction RegistrationType="rt1" RegistrationId="0x010100EB674074C71B4AA7BA42EF61F36ADA2E"
Id="CDocuemnt"
Rights="EditListItems"
Description="CDocument"
ImageUrl="Version.gif"
Title="CDocument"
Location="EditControlBlock"
RequireSiteAdministrator="FALSE"
Sequence="428">
    <UrlAction Url="javascript:__doPostBack('project.Document.CDocument','{ItemId}#{ListId}');"></UrlAction>
  </CustomAction>
0

You have a several options:

  1. Develop a WSP solution package to deploy a feature with the custom action. See Adding a Custom Action to a Display Form for List Items
  2. Create a SharePoint Add-ins that deploys the custom action.
  3. Provision the custom action with code using CSOM.
  4. Provision the custom action with PowerShell using the Add-PnpCustomAction cmdlet in the PNP framework.

However, it's only the first option that'll give you a feature. However, it'll only work with SharePoint on-premises if you create a farm solution. For SharePoint Online you'll need to develop it as a sandbox solution. They still work as long as they do not contain code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.