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"
                      Title="Invoke &apos;RibbonCustomAction1&apos; action">
              <CommandUIDefinition Location="Ribbon.ListItem.Actions.Controls._children">
                <Button Id="Ribbon.ListItem.Actions.RibbonCustomAction1Button"
                        Alt="Request RibbonCustomAction1"
                        LabelText="Request RibbonCustomAction1"
                        Image16by16="_layouts/15/images/placeholder16x16.png" />
              <CommandUIHandler Command="Invoke_RibbonCustomAction1ButtonRequest"
          </CommandUIExtension >

but while deploying this code give me error.I tried the same code in Sandbox solution and it is working fine.

enter image description here

Please let me know if any one of you also faced this issue

  • 1
    Copy/paste typo for the closing Elements missing the last > ? Other than that, maybe try another sequence number... the schema looks fine. I use javascript call like that in a custom action and it's working.
    – JayHell
    Commented Apr 29, 2016 at 12:31
  • yes that is copy paste error.I tried by changing sequence number but still it does not worked.can you please place your code here.
    – Codec
    Commented Apr 29, 2016 at 12:45
  • Try to put a different RegistrationId, put your list GUID hardcoded or 100 for custom list
    – JayHell
    Commented Apr 29, 2016 at 12:53
  • sorry for late reply.I have tried by changing RegistrationId both by 100 for custom list and list GUID but still it is displaying same error
    – Codec
    Commented May 2, 2016 at 4:07
  • What you are using? SharePoint App? Commented May 2, 2016 at 9:07

1 Answer 1


Please follow the following approach.

  • Create a Sandbox solution rather then creating the SharePoint App
  • Deploy your solution to your SharePoint Online Solution Gallery
  • Activate your solution
  • Activate the feature of your newly activated solution

I know this is not the ultimate solution but this solution worked at my end.

Let me know whether it helped you or not.

  • 1
    Sandbox solutions are obsolete according to Microsoft
    – michalh
    Commented Jun 29, 2018 at 10:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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