I have recently added a button to the account ribbon to send information to and from a company. The question is what is the best way to integrate the button with the XML code that was given? Should a web resource be created then the web resource placed within the code of the button? If so were would the code be placed? Here is the code for my custom button.
<RibbonDiffXml>
<CustomActions>
<CustomAction Id="Sample.account.grid.SendToOtherSystem.CustomAction" Location="Mscrm.HomepageGrid.account.MainTab.Collaborate.Controls._children" Sequence="41">
<CommandUIDefinition>
<Button Id="Sample.account.grid.SendToOtherSystem.Button" Command="Sample.account.grid.SendToOtherSystem.Command" LabelText="$LocLabels:Sample.account.SendToOtherSystem.LabelText" ToolTipTitle="$LocLabels:Sample.account.SendToOtherSystem.LabelText" ToolTipDescription="$LocLabels:Sample.account.SendToOtherSystem.ToolTip" TemplateAlias="o1" Image16by16="$webresource:sample_/icons/TIcon16x16.png" Image32by32="$webresource:new_RadioButton" />
</CommandUIDefinition>
</CustomAction>
<CustomAction Id="Sample.account.form.SendToOtherSystem.CustomAction" Location="Mscrm.Form.account.MainTab.Collaborate.Controls._children" Sequence="33">
<CommandUIDefinition>
<Button Id="Sample.account.form.SendToOtherSystem.Button" Command="Sample.account.form.SendToOtherSystem.Command" LabelText="$LocLabels:Sample.account.SendToOtherSystem.LabelText" ToolTipTitle="$LocLabels:Sample.account.SendToOtherSystem.LabelText" ToolTipDescription="$LocLabels:Sample.account.SendToOtherSystem.ToolTip" TemplateAlias="o1" Image16by16="$webresource:sample_/icons/TIcon16x16.png" Image32by32="$webresource:new_RadioButton" />
</CommandUIDefinition>
</CustomAction>
</CustomActions>
<Templates>
<RibbonTemplates Id="Mscrm.Templates"></RibbonTemplates>
</Templates>
<CommandDefinitions>
<CommandDefinition Id="Sample.account.grid.SendToOtherSystem.Command">
<EnableRules>
<EnableRule Id="Sample.account.WebClient.EnableRule" />
<EnableRule Id="Sample.account.grid.OneSelected.EnableRule" />
</EnableRules>
<DisplayRules>
<DisplayRule Id="Sample.account.WebClient.DisplayRule" />
</DisplayRules>
<Actions>
<JavaScriptFunction Library="$webresource:new_SendGPSData" FunctionName="send" />
</Actions>
</CommandDefinition>
<CommandDefinition Id="Sample.account.form.SendToOtherSystem.Command">
<EnableRules>
<EnableRule Id="Sample.account.WebClient.EnableRule" />
<EnableRule Id="Sample.account.form.NotNew.EnableRule" />
</EnableRules>
<DisplayRules>
<DisplayRule Id="Sample.account.form.FormStateNotNew.DisplayRule" />
<DisplayRule Id="Sample.account.WebClient.DisplayRule" />
</DisplayRules>
<Actions>
<JavaScriptFunction Library="$webresource:new_SendGPSData" FunctionName="send" />
</Actions>
</CommandDefinition>
</CommandDefinitions>
<RuleDefinitions>
<TabDisplayRules />
<DisplayRules>
<DisplayRule Id="Sample.account.form.FormStateNotNew.DisplayRule">
<FormStateRule State="Create" InvertResult="true" />
</DisplayRule>
<DisplayRule Id="Sample.account.WebClient.DisplayRule">
<CrmClientTypeRule Type="Web" />
</DisplayRule>
</DisplayRules>
<EnableRules>
<EnableRule Id="Sample.account.WebClient.EnableRule">
<CrmClientTypeRule Type="Web" />
</EnableRule>
<EnableRule Id="Sample.account.form.NotNew.EnableRule">
<FormStateRule State="Create" InvertResult="true" />
</EnableRule>
<EnableRule Id="Sample.account.grid.OneSelected.EnableRule">
<SelectionCountRule AppliesTo="SelectedEntity" Maximum="1" Minimum="1" />
</EnableRule>
</EnableRules>
</RuleDefinitions>
<LocLabels>
<LocLabel Id="Sample.account.SendToOtherSystem.LabelText">
<Titles>
<Title languagecode="1033" description="Check Serviceability" />
</Titles>
</LocLabel>
<LocLabel Id="Sample.account.SendToOtherSystem.ToolTip">
<Titles>
<Title languagecode="1033" description="Sends GPS Data to SpatialWeb" />
</Titles>