Removing a ribbon button in CRM 2011

I needed to remove the Save and Close button from the Case entity when the form is in Create mode.

1) Find the Id of the button we are interested in.

Look at the output from the “ribbon” project of the CRM 2011 SDK. Within incidentribbon.xml we find:-

  TemplateAlias="o1" />

We are interested in the Command value (Mscrm.SaveAndClosePrimary).

2) Export the entity as part of a blank solution. Open the corresponding customizations.xml and find the RibbonDiffXml section.

Expand the CommandDefinitions section and create new entries within it, using the Command value as follows:-


<CommandDefinitions />


<CommandDefinition Id="<strong>Mscrm.SaveAndClosePrimary</strong>">
<EnableRule Id="<strong>Mscrm.SaveAndClosePrimary</strong>.EnableRule" />
<DisplayRule Id="<strong>Mscrm.SaveAndClosePrimary</strong>.DisplayRule" />
      <JavaScriptFunction FunctionName="Mscrm.RibbonActions.saveAndCloseForm" Library="/_static/_common/scripts/RibbonActions.js">
        <CrmParameter Value="PrimaryControl" />

Copy the Actions section direct from the original file.

3) We now have two new rules (.EnableRule and .DisplayRule) which need to be defined within RuleDefinitions.

Complete the RuleDefinitions section as follows:-


<TabDisplayRules />
<DisplayRules />
<EnableRules />


<TabDisplayRules />
<DisplayRule Id="Mscrm.SaveAndClosePrimary.DisplayRule">
<FormStateRule Default="0" State="Create" InvertResult="true" />
<EnableRule Id="Mscrm.SaveAndClosePrimary.EnableRule">
<FormStateRule Default="0" State="Create" InvertResult="true" />

Microsoft have a good list of the various rules that can be implemented within this section. The two shown above will show and enable the button if the form is not in Create mode.

4) Zip, Import and Publish the entity solution and voila!

Leave a comment


  1. Thanks for your tips about this blog. One thing I would want to say is the fact purchasing gadgets items in
    the Internet is not new. Actually, in the past 10 years alone,
    the market for online electronic products has grown drastically.
    Today, you will find practically virtually any electronic system and product on the Internet, from cameras and camcorders to computer spare parts
    and gaming consoles.

  2. An impressive share! I have just forwarded this onto a colleague who has been doing a little
    research on this. And he in fact ordered me dinner due
    to the fact that I stumbled upon it for him…
    lol. So allow me to reword this…. Thanks for the meal!!
    But yeah, thanx for spending time to discuss this subject here on your

  3. Good day! I know this is kinda off topic but I’d figured I’d ask.
    Would you be interested in trading links or maybe guest
    writing a blog article or vice-versa? My site goes over a
    lot of the same topics as yours and I believe we could greatly benefit from each other.

    If you might be interested feel free to shoot me an e-mail.
    I look forward to hearing from you! Terrific blog by the way!

  4. Hi i am kavin, its my first occasion to commenting anyplace, when i read this article i thought i could also make comment
    due to this good post.

  5. Whats up very cool site!! Man .. Beautiful .. Amazing ..
    I’ll bookmark your website and take the feeds also?
    I am happy to find so many helpful information here
    in the submit, we need work out more techniques on this regard,
    thanks for sharing. . . . . .

  6. This is my first time pay a visit at here and i am in fact happy to read all at single place.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: