Hello Guys, I have come up with an interesting article on enabling/disabling the out of box ribbon items in CRM 2011. This article demonstrates the order entity where I would be disabling the “Create invoice button” based on a condition in jscript. The script returns “false” or “true” value.
Before we get started, here’s the list of requirements with which you need to be familiar:
- Microsoft Visual Studio 2010 / Notepad ++ (or XML editor)
- MS CRM SDK 2011
- Jscript
Walk-through
- Go to settings > customizations > solutions
- Click “new” add new solution
- Provide a valid name, publisher and your version number
- Save the solution
- Add the existing “Order” entity.
- Save & close the dialog
- Export the solution
- Unzip the archive and open the customization.xml file
- Search for “RibbonDiffXML” tag under the order entity
- Add the following code
- Save and close the file
- Zip all the three files Customization.xml, [Content_Types].xml and solution.xml
- Go to CRM application
- Go to settings > customizations > customize the system > web resources
- Click to add “new” web resource, provide a name “new_CustomRule.js”
- Add the following code
function HideExisting()
{
return false;
}
- Import the customizations
- Publish the customizations
- You can see the changes reflected
You can download the solution below.
Additional Information:
Cheers,
Apurv