Hide custom button in ribbon from a rule

Home Forums Classic DFFS Hide custom button in ribbon from a rule

Viewing 1 reply thread
  • Author
    Posts
    • #8074
      Alexander Bautz
      Keymaster

        I got this question:

        Hello –
        In your trigger section, there is the ability to hide the Edit button in the ribbon. Is there a way to hide a Custom Action button in the ribbon?

        Thanks.
        Christine

        This can be done by adding a function to the Custom JS section (in the CSS and JS tab) like this:
        (This example will hide the attach file button)

        function hideCustomButton(){
        	spjs.$("#Ribbon\\.ListForm\\.Edit\\.Actions\\.AttachFile-Large").hide();
        }

        Then you add this function name to the “Run these functions / trigger these rules” field in the rule.

        To find the ID of the custom button in your ribbon, use the developer tools (hit F12) and inspect the button.

        If the ID contains a period, you must escape it like in the example snippet above.

        Alexander

      • #8100
        chgrnet
        Participant

          Thanks so very much for this code, it worked perfectly!

      Viewing 1 reply thread
      • You must be logged in to reply to this topic.