Before Hiding Button from the Account Home page Grid
After Hiding the Button from the Account Home page Grid
Before Hiding button from the Account Form
After Hiding button from the Account Form
Follow the following steps to hide the button from the account entity
1. We needs to find the Id of the button " Add to Marketing List", which we wants to hide. To find the Id of this button go to the CRM Sdk, and find the "accountribbon.xml" file at "sdk\samplecode\cs\client\ribbon\exportribbonxml\exportedribbonxml". Open "accountribbon.xml" file and find the Id of the button which we wants to hide.
For "Add to Marketing List" button Id at Home page grid level is "Mscrm.HomepageGrid.account.AddToList"
For "Add to Marketing List" button Id at Form level is "Mscrm.Form.account.AddToList"
2. Now Export the solution and open the "Customization.xml" file for editing.
3. Find the <RibbonDiffXml> tag at Account entity level, add the following code
Here is the code to copy
<RibbonDiffXml>
<CustomActions>
<!-- Hide "Add to Marketing List" button at grid level, here Location will be the button id and HideActionId will be any unique id-->
<HideCustomAction Location="Mscrm.HomepageGrid.account.AddToList" HideActionId="Sample.HomepageGrid.account.HideMarketingList"/>
<!-- Hide "Add to Marketing List" button at Form level-->
<HideCustomAction Location="Mscrm.Form.account.AddToList" HideActionId="Sample.Form.account.HideMarketingList"/>
</CustomActions>
<Templates>
<RibbonTemplates Id="Mscrm.Templates"></RibbonTemplates>
</Templates>
<CommandDefinitions />
<RuleDefinitions>
<TabDisplayRules />
<DisplayRules />
<EnableRules />
</RuleDefinitions>
<LocLabels />
</RibbonDiffXml>
4. Now import the solution back into CRM. You can find the changes.
Thats it.. It's very simple to hide a button in crm2011. we can also use Display rules to hide the buttons. Based on the user security permission we can show the buttons using display rules.