CRM 2011:全局JavaScript和状态栏中的按钮 [英] CRM 2011: Global JavaScript and button in status bar

查看:42
本文介绍了CRM 2011:全局JavaScript和状态栏中的按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

当我单击此按钮时,我会打开div,其中包含有关用户及其得分的一些信息。

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


  1. 在哪里可以放置可以全局执行的Java脚本功能(例如jQuery)?如何调用该函数,要捕获什么事件?我需要在CRM这样的所有页面上都启用该按钮/功能。

  2. 顶部栏中该位置的ID是什么?我需要它来从脚本中放置该按钮。


推荐答案

您似乎要解决的CRM解决方案正在谈论这是

The CRM solution you appear to be talking about is this

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

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

This is obviously unsupported. However they achieve it by adding a dummy button to the ribbon, specifically the Jewel Menu. This button command is linked to a JS function in a webresource. The button is always hidden but the JS file is always loaded.

请注意,您的JS已加载到Main.aspx(根文档)中
从那里可以将HTML元素或javascript注入所需的框架中。 (导航或内容)

It should be noted that your JS is loaded into Main.aspx (the root document) From there its a matter of injecting HTML elements or javascript into the desired frame. (Nav or Content)

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

Here is the RibbonDiffXML to add to a 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>

这在根目录ImportExportXml中Customizations.xml
的元素您可能还需要通过UI将Application Ribbons作为解决方案组件添加

This goes in the root ImportExportXml element of the customizations.xml You may also need to add Application Ribbons as a solution component via the UI

这篇关于CRM 2011:全局JavaScript和状态栏中的按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆