In this post I will walk you through the process of creating a new ribbon button that will be able to open a HTML page from which we can access some crm context parameter such as language id and record id.
In this particular example I will be using the HTML page to host a Silverlight application.
First of all we need to export the solution that we want to customise, so navigate to settings-> Solutions and select the solution you want to export.
Once downloaded the solution open the customizations.xml file with your favourite editor.
Here is my customization:
<RibbonDiffXml>
<CustomActions>
<CustomAction Id="Imp.Form.Account.ShowHierarchy" Sequence="51" Location="Mscrm.Form.account.MainTab.ExportData.Controls._children">
<CommandUIDefinition>
<Button Id="Imp.Form.Account.ShowHierarchyButton" Image16by16="$webresource:new_Hierarchy16by16.gif" Image32by32="$webresource:new_Hierarchy32by32.gif" TemplateAlias="o1" LabelText="$LocLabels:Imp.Form.Account.ShowHierarchyTitle" ToolTipTitle="$LocLabels:Imp.Form.Account.ShowHierarchyTitle" ToolTipDescription="$LocLabels:Imp.Form.Account.ShowHierarchyTooltip" Command="Imp.Form.Account.ShowAccountHierarchyCommand" />
</CommandUIDefinition>
</CustomAction>
</CustomActions>
<Templates>
<RibbonTemplates Id="Mscrm.Templates"></RibbonTemplates>
</Templates>
<CommandDefinitions>
<CommandDefinition Id="Imp.Form.Account.ShowAccountHierarchyCommand">
<EnableRules></EnableRules>
<DisplayRules></DisplayRules>
<Actions>
<Url Address="$webresource:new_/SilverlightFromRibbonTestPage.html" PassParams="true"></Url>
</Actions>
</CommandDefinition>
</CommandDefinitions>
<RuleDefinitions>
<TabDisplayRules />
<DisplayRules />
<EnableRules />
</RuleDefinitions>
<LocLabels>
<LocLabel Id="Imp.Form.Account.ShowHierarchyTooltip">
<Titles>
<Title languagecode="1033" description="This will open a HTML page hosting a Silverlight application." />
</Titles>
</LocLabel>
<LocLabel Id="Imp.Form.Account.ShowHierarchyTitle">
<Titles>
<Title languagecode="1033" description="Open Page" />
</Titles>
</LocLabel>
</LocLabels>
</RibbonDiffXml>
Import the new customization.xml file and if you don't have any error you should be able to see a new button on the account form.
Hope you find this post useful.
Cheers , Luciano.