I am trying to create a new ribbon UserCustomAction for a SP2013 custom list list view customized with infopath. I need to use powershell.
I´ve read so far the following articles: Link 1 Link 2
This ist my code:
$ newUserCustomActionItemFormInfoPath = $ targetList.UserCustomActions.Add() $ newUserCustomActionItemFormInfoPath.Rights = "EditListItems" $ newUserCustomActionItemFormInfoPath.Location = "CommandUI.Ribbon" $ newUserCustomActionItemFormInfoPath.CommandUIExtension = '<CommandUIExtension> <CommandUIDefinitions> <CommandUIDefinition Location="Ribbon.Tabs.InfoPathListDisplayTab.Manage.Controls._children"> <Button Id="Ribbon.Tabs.InfoPathListDisplayTab.Manage.SendItemAsMail" Alt="Send mail" Sequence="503" Command="sendMessageAsMailInfoPathView" LabelText="Send mail" TemplateAlias="o1" Image32by32="/_layouts/15/images/discoveryExport_32x32.png" Image16by16="/_layouts/15/images/discoveryExport_16x16.png" /> </CommandUIDefinition> </CommandUIDefinitions> <CommandUIHandlers> <CommandUIHandler Command="sendMessageAsMailInfoPathView" CommandAction="javascript: sharepoint.common.management.createMail(''{ListId}'', {SelectedItemId});" /> </CommandUIHandlers> </CommandUIExtension >' $ newUserCustomActionItemFormInfoPath.Title = "Send mail" $ newUserCustomActionItemFormInfoPath.Update()
Everything is fine on the normal display view and on the list view ribbon. The button shows up. But if I try to add the button to the infopath ribbon it won´t show up.
I just want to know whether there is trick to get this to work. Unfortunately the given links doesn´t helped me out. Any other ideas?
Thank you!