Link to home
Start Free TrialLog in
Avatar of lweekly
lweekly

asked on

Adding a button to CRM 2011 ribbon

I have been laboring to add a button to the Contact Add tab for sending a text message.  I have a small icon that appears under Other Activities that works, but our users would like a large button just to the right of the E-Mail button.
 
All of the webresources exist and function from the original menu item.
 
I would greatly appreciate anyone that can spot what I am doing wrong and let me know.
 
Here's my RibbonDiffXml section, followed by the errors from the Error Log.
 
<RibbonDiffXml>
        <CustomActions >
          <CustomAction Id="Lon.contact.form.SendTextMessage.CustomAction"
              Location="Mscrm.Form.contact.Related.Activities.Controls._children"
              Sequence="25">
            <CommandUIDefinition>
              <Button Id="Lon.contact.form.SendTextMessage.Button"
              Command="Lon.contact.form.SendTextMessage.Command"
              LabelText="$LocLabels:Lon.contact.form.SendTextMessage.LabelText"
              ToolTipTitle="$LocLabels:Lon.contact.form.SendTextMessage.LabelText"
              ToolTipDescription="$LocLabels:Lon.contact.form.SendTextMessage.ToolTip"
              TemplateAlias="o1"
              Image16by16="$webresource:new_TextIcon16.png"
              Image32by32="$webresource:new_TextIcon32.png" />
            </CommandUIDefinition>
          </CustomAction>
          </CustomActions>  
        <Templates>
          <RibbonTemplates Id="Mscrm.Templates"></RibbonTemplates>
        </Templates>
        <CommandDefinitions>
          <CommandDefinition Id="Lon.contact.form.SendTextMessage.Command">
            <EnableRules>
              <EnableRule Id="Lon.contact.WebClient.EnableRule" />
              <EnableRule Id="Lon.contact.form.NotNew.EnableRule"/>
            </EnableRules>
            <DisplayRules>
              <DisplayRule Id="Lon.contact.form.FormStateNotNew.DisplayRule" />
              <DisplayRule Id="Lon.contact.WebClient.DisplayRule" />
            </DisplayRules>
            <Actions>
              <JavaScriptFunction Library="$webresource:new_SendTextMessage.js"
              FunctionName="send" />
            </Actions>
          </CommandDefinition>
        </CommandDefinitions>
        <RuleDefinitions>
          <TabDisplayRules />
          <DisplayRules>
            <DisplayRule Id="Lon.contact.form.FormStateNotNew.DisplayRule">
              <FormStateRule State="Create" InvertResult="true" />
            </DisplayRule>
          </DisplayRules>
          <EnableRules>
            <EnableRule Id="Lon.contact.WebClient.EnableRule">
              <CrmClientTypeRule Type="Web" />
            </EnableRule>
            <EnableRule Id="Lon.contact.form.NotNew.EnableRule">
              <FormStateRule State="Create" InvertResult="true" />
            </EnableRule>
           </EnableRules>
          </RuleDefinitions>
        <LocLabels>
          <LocLabel Id="Lon.contact.form.SendTextMessage.LabelText">
            <Titles>
              <Title languagecode="1033" description="Send Text Message" />
            </Titles>
          </LocLabel>
          <LocLabel Id="Lon.contact.form.SendTextMessage..ToolTip">
            <Titles>
              <Title languagecode="1033" description="Send Text Message to this Contact" />
            </Titles>
          </LocLabel>
        </LocLabels>
      </RibbonDiffXml>
 
Error Log Items:
The ribbon item 'Lon.contact.form.SendTextMessage.Command' is dependent on <DisplayRule Id="Lon.contact.WebClient.DisplayRule" />.
The ribbon item 'Lon.contact.form.SendTextMessage.Command' is dependent on Web resource id='new_SendTextMessage.js'.
The ribbon item 'Lon.contact.form.SendTextMessage.Button' is dependent on <LocLabel Id="Lon.contact.form.SendTextMessage.ToolTip" />.
The ribbon item 'Lon.contact.form.SendTextMessage.Button' is dependent on Web resource id='new_TextIcon16.png'.
The ribbon item 'Lon.contact.form.SendTextMessage.Button' is dependent on Web resource id='new_TextIcon32.png'.
The ribbon item 'Lon.contact.form.SendTextMessage.Command' is dependent on <DisplayRule Id="Lon.contact.WebClient.DisplayRule" />.
Avatar of Chinmay Patel
Chinmay Patel
Flag of India image

Hi Iweekly,

Are you trying export this solution or you are just customizing the default solution?
Or you are getting this error when you try to publish?

Regards,
Chinmay.
Have you already looked at this tool? http://ribboneditor.codeplex.com/

Hi Iweekly,

Just a thought, are you sure that the webresources you have added does have the extensions as you have mentioned in your RibbonDiffXml?
I am trying to import your Ribbon in my CRM system, and after adding these resources to the solution this errors are gone, now I am just looking at the Command definitions.

Regards,
Chinmay.
Could this be the error <LocLabel Id="Lon.contact.form.SendTextMessage..ToolTip">?
ASKER CERTIFIED SOLUTION
Avatar of Chinmay Patel
Chinmay Patel
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial