Hot answers tagged

17

You can associate your custom action to a specific list by using the RegistrationId property. Example: <CustomAction ControlAssembly="MagicalProject.Actions" ControlClass="MagicalProject.Actions" ControlSrc="/_layouts/MagicalSite/MagicalPage.aspx" Description="This is my custom action which does magical ...


13

You can use one of the following methods: SP.UI.ModalDialog.showWaitScreenSize or SP.UI.ModalDialog.showWaitScreenWithNoClose. Example: waitDialog = SP.UI.ModalDialog.showWaitScreenWithNoClose("Loading...", "Please wait while data is retrieved...", 60, 280); --------wait for something-------- waitDialog.close(SP.UI.DialogResult.OK); Check out all ...


8

http://msdn.microsoft.com/en-us/library/ff458385.aspx: {SiteUrl} – The fully qualified URL to the site (Url). The SharePoint code proves it - here's the SPCustomActionElement.ReplaceUrlTokens method: internal static string ReplaceUrlTokens(string urlAction, SPWeb web, SPList list, SPListItem item) { if (string.IsNullOrEmpty(urlAction)) ...


6

I finally found how all the things is working. First, there is a server control SocialNavigationControl. This control is rendered within SocialData.ascx. There is also a delegate control override in SocialDelegateControl.xml file of SocialRibbonControl feature. This override applies to GlobalSiteLink2 delegate control. Finally, the v4.master page ...


6

Ribbon buttons cannot be hidden using HideCustomAction, at all. At least, I've tried this and it doesn't work. You should use CustomAction for this purpose, with empty CommandUIDefinition elements, like this: <CustomAction Id="RemoveRibbonButton" Location="CommandUI.Ribbon" > <CommandUIExtension> <CommandUIDefinitions> ...


5

You can reference an external js file like: <CustomAction Id="Ribbon.Library.Actions.Scripts" Location ="ScriptLink" ScriptSrc="/_layouts/DocumentTabTwo/Button2.js" /> This will ensure the functions from the file are accessible from your CommandUIHandler


5

I've made some research on the subject of RegistrationId and RegistrationType according to declarative Ribbon customization. All my findings can be found here: RegistrationType & RegistrationId in SharePoint 2010 declarative Ribbon customizations As a short summary: You can use all four registration types to target some content for Ribbon ...


4

Just hook it to the 0x01 Content Type. An example of the syntax used in our SharePoint Audit suite is as follows: <!-- Add a new action to the SharePoint 2010 Ribbon bar for each list to show all audit entries for a list Item --> <CustomAction Id="Muhimbi.SharePoint.Audit.Ribbon.ListItem.Share.ViewAuditLog.Action" Location="CommandUI.Ribbon" ...


4

For security reasons, you cannot access the web.config settings from javascript so the best approach would probably be to write a custom control / web part that can read the setting and then write it into the page into a script block.


4

First of all there is no document set library in SharePoint. There is only a content type that is called "Document Set" and this can exists on certain document libraries. You need in to use in your declaration the RegistrationType="ContentType" and for the RegistrationId="0x0120D520". Last one is the id of the content Type "Document Set". The required ...


4

Here is some js that should load efter the ribbon is loaded: SP.SOD.executeOrDelayUntilScriptLoaded(function() { // Your code here }, "sp.ribbon.js"); More about modifying in this blogpost Edit: // Fires ‘ribbontabselected’ after the ribbon has been initialized after load ExecuteOrDelayUntilScriptLoaded(function () { var pm = ...


3

No need to do an async call SP.ListOperation.Selection.getSelectedItems(ctx) should get you all the selected items on the page. var ctx = SP.ClientContext.get_current(); var items = SP.ListOperation.Selection.getSelectedItems(ctx); for (var i in items) { //Do something }


3

Are you deploying it as a Site scope feature? If it's a Web scope feature then you have to activate it on the relevant subsites. For any customizations with Ribbon, make sure to clear the browser's cache to see the changes.


3

Ok I found the solution with this modified xml I did achieve expected results: <CustomAction Id="Ribbon.ListItem.TagsAndNotes.NewLike" Location="CommandUI.Ribbon" Title="New version of I Like It"> <CommandUIExtension> <CommandUIDefinitions> <CommandUIDefinition ...


3

You can do that with HideCustomAction. You can get GroupId and HideActionId from the action itself. The custom action is as below (taken from C:\Program Files\Common Files\microsoft shared\Web Server Extensions\14\TEMPLATE\FEATURES\IPFSSiteFeatures\FormSettings.xml) <CustomAction Id="IPFSSettingsListEditPage" RegistrationType="List" ...


3

it took me 2 days, but I figured it out. It turned out quite simple: Everything with the code was ok. The problem is that the feature had to be activated by default in the Administrative Web site(the feature was scoped as Web). If you have a problem like this, you just add the following code to the Feature Manifest as a Feature attribute: ...


3

This can be done by creating a CustomAction. Specify Location="CommandUI.Ribbon.DisplayForm" in order to place a button in Display form. Here is an example: <CustomAction Id="ExportVersionHistory.DisplayForm" RegistrationType="ContentType" RegistrationId="0x01" Location="CommandUI.Ribbon.DisplayForm" Rights="ViewListItems"> ...


3

Best way to add Authorization to a Custom Action button in SharePoint Designer is to add the required rights access in the "Rights mask:". For a list of available Rights Mask that you can use see: https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spbasepermissions.aspx.


3

I think you are almost there except that you have used assignment operator which will always return TRUE. Instead you have to use comparison '==' or '===' operators. update in below line EnabledScript="javascript:SP.ListOperation.Selection.getSelectedItems().length === 1;"


3

Everything works fine, I've even created a test project for you: http://www.4shared.com/zip/EwqRtH6c/ScriptLinkTest.html. Look at it. Did you check your js file is loaded correctly on the page?


3

AFAIK the "i like it" controls are not part of the ribbon? If you want to replace the controls, you can create a custom control that inherits from SocialNotificationBase and render your own content in the OnLoad control public class ReitanSocialNotification : SocialNotificationBase { public ReitanSocialNotification() { ...


3

To limit the Custom action to a specific type of list you need to specify RegistrationType and RegistrationId like this: <!-- Microsoft.SharePoint.StandardMenu : ActionsMenu : Site Actions menu of document library --> <CustomAction Id="CustomWareCustomActions.Microsoft.SharePoint.StandardMenu.CustomList.ActionsMenu" RegistrationType="List" ...


3

Using {SiteUrl} token is nice, thanks to Alex Boev. Just to mention an alternative, you can use SharePoint javascript API to get the web url. In your example you want to open an application page (from layouts folder). There is a helper function for doing that getLayoutsPageUrl: SP.Utilities.Utility.getLayoutsPageUrl('myPath/EditWebInfo.aspx') So your ...


3

SharePoint 2010 ribbon doesn't have anything in common with 2007's DisplayFormToolBar. The custom action Location attribute should be set to "CommandUI.Ribbon" for adding something to ribbon. Then, you should provide special XML for button. Since SP2010 ribbon is a client-side thing, no C# code is involved here. You can find a simple example of adding a ...


3

This was tough when I started doing it today. It is possible via feature using a CustomAction element in the elements.xml and some code. I tried a no-code solution but it was not possible. <CustomAction Id="HideCreateSiteInSiteActions" Location="Microsoft.SharePoint.StandardMenu" GroupId="SiteActions" Sequence="901" ...


3

This is quite common when first developing an Action. Some things to check: Restart SharePoint Designer and IIS. Clear the SharePoint Designer Workflow Assembly Cache. Double check the strong name in the AuthorizedType element (use reflector to get the full signature of the Assembly). Check the syntax in your Actions file. It is my experience that if you ...


3

There are many example of this on the Internet. Here is one of them: SPD 2010 Custom Workflow Activity


3

This is XML to hide ManageWorkflows button. <?xml version="1.0" encoding="utf-8"?> <Elements xmlns="http://schemas.microsoft.com/sharepoint/"> <CustomAction Id="RemoveRibbonButton" Location="CommandUI.Ribbon"> <CommandUIExtension> <CommandUIDefinitions> <CommandUIDefinition ...


3

You could delete the specified UserCustomAction by Sequence property as demonstrated below: function deleteCustomAction(sequenceNo,success,error) { var ctx = new SP.ClientContext(); var site = ctx.get_web(); var userCustomActions = site.get_userCustomActions(); ctx.load(userCustomActions); ctx.executeQueryAsync(function(){ ...


2

You mean like using a link? Such as this one: {Site URL}/_vti_bin/owssvr.dll?CS=109&Using=_layouts/query.iqy&List={List GUID}&View={View GUID}&CacheControl=1 from the post Create Link to Export Library Contents to Excel



Only top voted, non community-wiki answers of a minimum length are eligible