CRM 2011:状态栏中的全局JavaScript和按钮

CoY*_*oTe 3 javascript dynamics-crm-2011

我在CRM 2011中并不是那么新,但我遇到了一个大问题......我在网上找到了一些解决方案,在CRM中建立了一些评分/排名系统.当我看到顶部状态栏中的星标,屏幕右上角的用户名旁边的功能区按钮栏时,我感到非常困惑.

在此输入图像描述

当我点击这个按钮时,我打开div,其中包含有关用户的一些信息以及他们拥有的分数.

  1. 我可以在哪里放置可以全局执行的Java Script函数(例如jQuery)?如何调用该函数,捕获什么事件?我需要在这个CRM中的所有页面上激活此按钮/功能.
  2. 顶栏中那个地方的id是多少?我需要它从我的脚本中放置此按钮.

Ada*_*lls 6

您似乎在谈论的CRM解决方案就是这样

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

这显然是不受支持的.然而,他们通过在功能区上添加一个虚拟按钮来实现它,特别是宝石菜单.此按钮命令链接到Web资源中的JS函数.该按钮始终处于隐藏状态,但始终会加载JS文件.

应该注意的是,你的JS被加载到Main.aspx(根文档)从那里它是一个注入HTML元素或javascript到所需框架的问题.(导航或内容)

这是要添加到解决方案的RibbonDiffXML.

<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>
Run Code Online (Sandbox Code Playgroud)

这位于customizations.xml的根ImportExportXml元素中您可能还需要通过UI将Application Ribbons添加为解决方案组件