Bemærk
Adgang til denne side kræver godkendelse. Du kan prøve at logge på eller ændre mapper.
Adgang til denne side kræver godkendelse. Du kan prøve at ændre mapper.
Important
SharePoint Add-ins reached end of life in SharePoint Online on April 2, 2026. Both SharePoint-hosted and provider-hosted Add-ins are retired and no longer work in SharePoint Online, including government clouds. Add-in development, deployment, and usage guidance is retained for historical reference and for applicable SharePoint Server scenarios, not for new SharePoint Online solutions.
SharePoint Server Add-ins deployed through an on-premises app catalog are not retired by this change. Acquiring SharePoint Add-ins from the public marketplace ended on April 2, 2026 for SharePoint Server.
This retirement does not retire SharePoint REST APIs, CSOM, JSOM, or SharePoint Framework (SPFx). For SharePoint Online, use SPFx for user interface extensions and Microsoft Entra ID for authentication to external applications. See the retirement announcement and Add-in migration guidance.
Summary
The approach you take to modify list item menus and the ribbon in SharePoint is different in the new SharePoint Add-in model than it was with Full Trust Code. In a typical Full Trust Code (FTC) / Farm Solution scenario, list item menus and ribbon modifications were defined in XML (custom actions), packaged in features, and deployed via SharePoint Solutions.
In an SharePoint Add-in model scenario, you use the SharePoint Client-side Object Model (CSOM) or REST API to create custom actions that modify list item menus and the ribbon. This pattern is commonly referred to as the remote provisioning pattern.
High-level guidelines
As a rule of a thumb, we would like to provide the following high-level guidelines for creating and deploying custom actions in the new SharePoint Add-in model.
- Custom actions may be used to modify list item menus and the ribbon.
- You cannot hide menu items using a custom action directly from an Add-in that implements a custom action.
- This is because the HideCustomAction Element (MSDN API Documentation) is not available in the SharePoint ECMA Clients-ide Object Model (CSOM) - UserCustomAction properties (MSDN API Documentation), or the SharePoint/Office 365 REST APIs - SP.UserCustomActionCollection object (sp.js) (MSDN API Documentation).
- If you need to hide menu items, you must use a custom action to embed JavaScript or customized CSS in SharePoint pages. The JavaScript or CSS embedded in the SharePoint pages hides the menu item.
- Use the SharePoint Client-side Object Model (CSOM), and/or the SharePoint/Office 365 REST APIs to implement custom actions.
Getting started
The following sample demonstrates how to add a custom action to the site settings menu in the host web, how to show a dialog in a custom action, how to hide a dialog that hosts a page from a remote add-in web, and how to use a custom action to create lists and set the theme of a web.
Provisioning.SiteModifier (O365 PnP Sample)
Here you can see the link the custom action in the sample adds to the Site Settings menu.

Here you can see the popup window opened via the Modify Site link.

Related links
- User controls and Web controls (SharePoint Add-in Recipe)
- Guidance articles at https://aka.ms/OfficeDevPnPGuidance
- References in MSDN at https://aka.ms/OfficeDevPnPMSDN
- Videos at https://aka.ms/OfficeDevPnPVideos
PnP samples
- Provisioning.SiteModifier (O365 PnP Sample)
- Samples and content at Microsoft 365 Patterns and Practices (PnP)
Applies to
- Office 365 Multi Tenant (MT)
- Office 365 Dedicated (D)
- SharePoint 2013 on-premises