For all of you who wanted to know how to do this, here are the steps:
- Make sure the custom entity is part of the solution you want to export and modify
- Export the solution and edit the customizations.xml file
- In this file, each entity has its own <Entity> tag so you need to find the one that suits your needs (example: if your custom entity is called new_test, you should look for the node
<Entity>
<Name LocalizedName="Test" OriginalName="Test">new_test</Name>
[...] - In this node, you should see a sub-node starting with <RibbonDiffXml>, which is the node containing the ribbons elements for your particular entity
- In this new section, you should only modify the <CustomActions /> node, which is the node containing all the custom actions for the entity’s ribbon: add a new button, hide a button, change the behavior of a particular button, etc.
- Under <CustomActions>, place the following code if you want to hide the ‘Save as complete’ button
<HideCustomAction HideActionId="CA_HideSaveAsComplete" Location="Mscrm.Form.new_test.SaveAsComplete" />
- Do not forget to close the <CustomActions> tag after it!
- Under <CustomActions>, place the following code if you want to hide the ‘Save as complete’ button
- The complete code should look like this:
<RibbonDiffXml>
<CustomActions>
<HideCustomAction HideActionId="CA_HideSaveAsComplete" Location="Mscrm.Form.new_test.SaveAsComplete" />
</CustomActions>
<Templates>
<RibbonTemplates Id="Mscrm.Templates"></RibbonTemplates>
</Templates>
<CommandDefinitions />
<RuleDefinitions>
<TabDisplayRules />
<DisplayRules />
<EnableRules />
</RuleDefinitions>
<LocLabels />
</RibbonDiffXml>
After having saved the modified customizations.xml file, compress all the solution files in a new ZIP package and import it back in Microsoft CRM.
Once the package has been published, you should “see” that the ‘Save as complete’ button has disappeared on your entity’s form