Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Ribbon Workbench - Button does nothing

Posted on by 190

Hello everyone,

I am playing around with the Ribbon Workbench for CRM on-premise  2016. I want to create a butto, which opens a new tab in the browser with google and a search function related to the currently opened company in our account entity.

I created a button in the Ribbon Workbench and I also set a picture. I managed to display my button in the account ribbon bar, but when I click the button nothing happens. Even though I assigned my source code to the button.

My source code to open the google window with the company is:

___

function google() {

var Firmenname = Xrm.Page.getAttribute("name").getValue();
window.open("http://www.google.de/search?q="+Firmenname );
}
this.google=google;

___

I'm not very introduced into coding in general and especially javascript.

Maybe someone could help me to get it working. I've read some howTo's about the Ribbon Workbench but none of them were detailed enough to solve my problem.

I'm looking forward to hearing from you!

Kind regards

Maurice Renz

*This post is locked for comments

  • ScottDurow Profile Picture
    ScottDurow 50,177 on at
    RE: Ribbon Workbench - Button does nothing

    The xml looks fine - the most common reason for javascript not being called is if there is a syntax error in the webresource.

  • maurice.renz Profile Picture
    maurice.renz 190 on at
    RE: Ribbon Workbench - Button does nothing

    Thank you for the tip! I could have seen that...

    I adjusted that and published the solution again but the button still does not react... I also tried a private window to avoid problems with cookies etc.

  • ScottDurow Profile Picture
    ScottDurow 50,177 on at
    RE: Ribbon Workbench - Button does nothing

    Thanks for the xml - in your javascript above, the function name is 'google' but the command is referencing a function "Googleoeffnen"

  • maurice.renz Profile Picture
    maurice.renz 190 on at
    RE: Ribbon Workbench - Button does nothing

    Hi,

    thanks for your reply.

    See the ribbon xml below.

    ____________________________________________________________

    <?xml version="1.0" encoding="utf-16"?>

    <RibbonDiffXml xmlns:xsd="www.w3.org/.../XMLSchema&quot; xmlns:xsi="www.w3.org/.../XMLSchema-instance&quot;>

     <CustomActions>

       <CustomAction Id="new.account.Button2.Button.CustomAction" Location="Mscrm.Form.account.MainTab.Save.Controls._children" Sequence="66">

         <CommandUIDefinition>

           <Button Alt="$LocLabels:new.account.Button2.Button.Alt" Command="new.account.Command0.Command" Id="new.account.Button2.Button" Image32by32="$webresource:new_google32" Image16by16="$webresource:new_google16" LabelText="$LocLabels:new.account.Button2.Button.LabelText" Sequence="66" TemplateAlias="o1" ToolTipTitle="$LocLabels:new.account.Button2.Button.ToolTipTitle" ToolTipDescription="$LocLabels:new.account.Button2.Button.ToolTipDescription" />

         </CommandUIDefinition>

       </CustomAction>

     </CustomActions>

     <Templates>

       <RibbonTemplates Id="Mscrm.Templates" />

     </Templates>

     <CommandDefinitions>

       <CommandDefinition Id="new.account.Command0.Command">

         <EnableRules />

         <DisplayRules />

         <Actions>

           <JavaScriptFunction FunctionName="Googleoeffnen" Library="$webresource:new_Googlebutton" />

         </Actions>

       </CommandDefinition>

     </CommandDefinitions>

     <RuleDefinitions>

       <TabDisplayRules />

       <DisplayRules />

       <EnableRules />

     </RuleDefinitions>

     <LocLabels>

       <LocLabel Id="new.account.Button2.Button.LabelText">

         <Titles>

           <Title description="Google" languagecode="1031" />

         </Titles>

       </LocLabel>

       <LocLabel Id="new.account.Button2.Button.ToolTipTitle">

         <Titles>

           <Title description="Google" languagecode="1031" />

         </Titles>

       </LocLabel>

       <LocLabel Id="new.account.Button2.Button.ToolTipDescription">

         <Titles>

           <Title description="Öffnet die Firma über Google" languagecode="1031" />

         </Titles>

       </LocLabel>

       <LocLabel Id="new.account.Button2.Button.Alt">

         <Titles>

           <Title description="Google" languagecode="1031" />

         </Titles>

       </LocLabel>

     </LocLabels>

    </RibbonDiffXml>

    ____________________________________________________________

  • ScottDurow Profile Picture
    ScottDurow 50,177 on at
    RE: Ribbon Workbench - Button does nothing

    Hi,

    Could you post the ribbon xml that you see in the xml tab after a refresh?

    Thanks!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans