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" />.
Microsoft Dynamics

Avatar of undefined
Last Comment
Chinmay Patel

8/22/2022 - Mon
Chinmay Patel

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.
dequaja

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

Chinmay Patel

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.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
dequaja

Could this be the error <LocLabel Id="Lon.contact.form.SendTextMessage..ToolTip">?
ASKER CERTIFIED SOLUTION
Chinmay Patel

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question