I want to call my javascript code in custom ribbon action in SharePoint online. I tried this code.
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<CustomAction Id="6e661d80-ffa2-4460-b4d9-5b88cd1cbdf6.RibbonCustomAction1"
RegistrationType="List"
RegistrationId="{$ListId:Lists/Employee;}"
Location="CommandUI.Ribbon"
Sequence="10001"
Title="Invoke 'RibbonCustomAction1' action">
<CommandUIExtension>
<CommandUIDefinitions>
<CommandUIDefinition Location="Ribbon.ListItem.Actions.Controls._children">
<Button Id="Ribbon.ListItem.Actions.RibbonCustomAction1Button"
Alt="Request RibbonCustomAction1"
Sequence="100"
Command="Invoke_RibbonCustomAction1ButtonRequest"
LabelText="Request RibbonCustomAction1"
TemplateAlias="o1"
Image32by32="_layouts/15/images/placeholder32x32.png"
Image16by16="_layouts/15/images/placeholder16x16.png" />
</CommandUIDefinition>
</CommandUIDefinitions>
<CommandUIHandlers>
<CommandUIHandler Command="Invoke_RibbonCustomAction1ButtonRequest"
CommandAction="javascript:alert('hii');"/>
</CommandUIHandlers>
</CommandUIExtension >
</CustomAction>
</Elements>
but while deploying this code give me error.I tried the same code in Sandbox solution and it is working fine.
Please let me know if any one of you also faced this issue