0

I'm trying to add a button here:

enter image description here

 <CustomAction
      Id="SaveAndCheckIn.EditForm"
      Location="CommandUI.Ribbon.EditForm"
      Rights="EditListItems">
    <CommandUIExtension>
      <CommandUIDefinitions>
        <CommandUIDefinition
        Location="Ribbon.DocLibListForm.Edit.Commit">
          <Button
          Id="Ribbon.ListForm.Edit.Manage.Controls.SaveAndCheckIn"
          Alt="Save and Check In the document."
          LabelText="Save and Check In"
          Image16by16="/_layouts/15/1033/images/formatmap16x16.png?rev=40"
          Image32by32="/_layouts/15/1033/images/formatmap32x32.png?rev=40"
          Command="SaveAndCheckIn"
          Sequence="1"
          TemplateAlias="o1"
          ToolTipTitle="Save and Check In"
          ToolTipDescription="Save and Check In the document."/>
        </CommandUIDefinition>
      </CommandUIDefinitions>
      <CommandUIHandlers>
        <CommandUIHandler
        Command="SaveAndCheckIn"
        CommandAction=""
        EnabledScript=""/>
      </CommandUIHandlers>
    </CommandUIExtension>
  </CustomAction>
1

Here you go:

<CustomAction
Id="JustMyButton"
RegistrationType= "List"
RegistrationId= "101"
Location= "CommandUI.Ribbon.EditForm"
Sequence= "100"
Title= "Just My Button" >
<CommandUIExtension>
  <CommandUIDefinitions>

    <CommandUIDefinition
        Location="Ribbon.DocLibListForm.Edit.Commit.Controls._children">
      <Button 
         Id="CustomActionDemo.DisplayFormAction"
         Command="Command.CustomActionDemo.DisplayFormAction"
         LabelText="My Button"
         Sequence="1"
         Description="Just My Button"
         Image32by32="_layouts/Images/Custom_Settings/icon_32x32.png"
         Image16by16="_layouts/Images/Custom_Settings/icon_16x16.png"
         Alt="Just My Button"
         TemplateAlias="o1" />
    </CommandUIDefinition>
  </CommandUIDefinitions>
  <CommandUIHandlers>

    <CommandUIHandler
            Command="Command.CustomActionDemo.DisplayFormAction"
            CommandAction="javascript:alert('Hi!');" />
  </CommandUIHandlers>

</CommandUIExtension>

Screenshot of result:

enter image description here

Best regards,

Lee Liu

0

I was able to add a button to the first position of the Commit group by using Sequence="0" - but I was doing it through SharePoint Designer. Should be the same logic though.

  • Is the xml correct, just the sequence needs updating? – Batman Oct 21 '17 at 0:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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