CRM 2011: global JavaScript and a button in the status bar

I'm not so new to CRM 2011, but I have one big problem ... I found some solution on the net that does a rating / ranking system in CRM. I was completely confused when I saw a star in the top status bar, above the ribbon buttons bar, next to the username in the right corner of the screen.

enter image description here

When I click on this button, I open a div with some information about the users and the ratings they have.

  • Where can I put a Java Script function (e.g. jQuery) that can be executed globally? How to call this function, what event to catch? I need this button / function to be active on all pages in CRM, like this one.
  • What is the identifier of this place in the top bar? I need this to put this button from my script.
+3
source share
1 answer

The CRM solution you are talking about is

http://www.wave-access.com/Public_en/ms_crm_gamification_product.aspx

This is clearly not supported. However, they achieve this by adding a dummy button to the ribbon, in particular the Jewel Menu. This button command is associated with the JS function in webresource. The button is always hidden, but the JS file is always loaded.

It should be noted that your JS is loaded into Main.aspx (the root document). This raises the question of introducing HTML elements or javascript into the desired frame. (Nav or Content)

Here RibbonDiffXML adds to the solution.

<RibbonDiffXml> <CustomActions> <CustomAction Id="Dummy.CustomAction" Location="Mscrm.Jewel.Controls1._children" Sequence="41"> <CommandUIDefinition> <Button Id="Dummy" Command="Dummy.Command" Sequence="50" ToolTipTitle="$LocLabels:Dummy.LabelText" LabelText="$LocLabels:Dummy.LabelText" ToolTipDescription="$LocLabels:Dummy.Description" TemplateAlias="isv" /> </CommandUIDefinition> </CustomAction> </CustomActions> <Templates> <RibbonTemplates Id="Mscrm.Templates"></RibbonTemplates> </Templates> <CommandDefinitions> <CommandDefinition Id="Dummy.Command"> <EnableRules /> <DisplayRules> <DisplayRule Id="Dummy.Command.DisplayRule.PageRule" /> </DisplayRules> <Actions> <JavaScriptFunction Library="$webresource:MyGlobal.js" FunctionName="Anything" /> </Actions> </CommandDefinition> </CommandDefinitions> <RuleDefinitions> <TabDisplayRules /> <DisplayRules> <DisplayRule Id="Dummy.Command.DisplayRule.PageRule"> <PageRule Address="aaaa" /> </DisplayRule> </DisplayRules> <EnableRules /> </RuleDefinitions> <LocLabels> <LocLabel Id="Dummy.Description"> <Titles> <Title languagecode="1033" description="Description" /> </Titles> </LocLabel> <LocLabel Id="Dummy.LabelText"> <Titles> <Title languagecode="1033" description="Description" /> </Titles> </LocLabel> </LocLabels> 

This happens in the root element of ImportExportXml of the customizations.xml file. You may also need to add Application Ribbons as a solution component through the user interface.

+6
source

Source: https://habr.com/ru/post/975126/


All Articles