Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 82002

XML Button

$
0
0

I am trying to create a button using XML that is part of the account ribbon grid and form.  I have already created the button but I am trying to insert Java into it.  I need to be able to insert multiple Java commands into it.  I seem to only be able to do two.  I have created the web resources and the Java is in Dynamics.  Does anyone have any suggestions on building a custom button and how to insert Java.  Here is the code below.  I am using a code that came from and SDK template.  Am I going about this the wrong way?  Thanks

<ImportExportXml xmlns:xsi="www.w3.org/.../XMLSchema-instance">

 <Entities>

   <Entity>

     <Name LocalizedName="Account" OriginalName="Account">Account</Name>

     <ObjectTypeCode>1</ObjectTypeCode>

     <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_proj4jscompressed" 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_Proj4js" FunctionName="btnToUTM_OnClick" />

           </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>

         </LocLabel>

       </LocLabels>

     </RibbonDiffXml>

   </Entity>

 </Entities>

 <Roles></Roles>

 <Workflows></Workflows>

 <FieldSecurityProfiles></FieldSecurityProfiles>

 <Templates />

 <RibbonDiffXml>

   <CustomActions />

   <Templates>

     <RibbonTemplates Id="Mscrm.Templates"></RibbonTemplates>

   </Templates>

   <CommandDefinitions />

   <RuleDefinitions>

     <TabDisplayRules />

     <DisplayRules />

     <EnableRules />

   </RuleDefinitions>

   <LocLabels />

 </RibbonDiffXml>

 <EntityMaps />

 <EntityRelationships />

 <OrganizationSettings />

 <optionsets />

 <WebResources>

   <WebResource>

     <WebResourceId>{afe14434-85ad-df11-bcbe-00155d016807}</WebResourceId>

     <Name>sample_/icons/TIcon16x16.png</Name>

     <DisplayName>sample_/icons/TIcon16x16.png</DisplayName>

     <Description>A 16x16 pixel icon showing the letter 'T'.</Description>

     <WebResourceType>5</WebResourceType>

     <IsCustomizable>1</IsCustomizable>

     <CanBeDeleted>1</CanBeDeleted>

     <IsHidden>0</IsHidden>

     <FileName>/WebResources/sample_iconsTIcon16x16pngAFE14434-85AD-DF11-BCBE-00155D016807</FileName>

   </WebResource>

   <WebResource>

     <WebResourceId>{49cb1950-85ad-df11-bcbe-00155d016807}</WebResourceId>

     <Name>sample_/icons/TIcon32x32.png</Name>

     <DisplayName>sample_/icons/TIcon32x32.png</DisplayName>

     <Description>A 32x32 pixel icon showing the letter 'T'.</Description>

     <WebResourceType>5</WebResourceType>

     <IsCustomizable>1</IsCustomizable>

     <CanBeDeleted>1</CanBeDeleted>

     <IsHidden>0</IsHidden>

     <FileName>/WebResources/sample_iconsTIcon32x32png49CB1950-85AD-DF11-BCBE-00155D016807</FileName>

   </WebResource>

   <WebResource>

     <WebResourceId>{566418ff-73b7-df11-840e-00155dba380f}</WebResourceId>

     <Name>sample_SendToOtherSystem.js</Name>

     <DisplayName>SendToOtherSystem.js</DisplayName>

     <WebResourceType>3</WebResourceType>

     <IsCustomizable>1</IsCustomizable>

     <CanBeDeleted>1</CanBeDeleted>

     <IsHidden>0</IsHidden>

     <FileName>/WebResources/sample_SendToOtherSystemjs566418FF-73B7-DF11-840E-00155DBA380F</FileName>

   </WebResource>

 </WebResources>

 <Languages>

   <Language>1033</Language>

 </Languages>

</ImportExportXml>


Viewing all articles
Browse latest Browse all 82002

Trending Articles