none
CRM 2011 在自定义实体的Ribbon上,添加一个按钮,报错。(完全仿照crm2011 sdk中的操作Walkthrough: Add a Custom Button to an Existing Group for a Specific Entity) RRS feed

  • 问题

  • 基本上是仿照sdk中的例子做的, Walkthrough: Add a Custom Button to an Existing Group for a Specific Entity) 如果下面描述的不清楚,请联系我,我会尽量详细反映问题的。因为好像不能截图。

    下面是我在导出的customizations.xml 中自己添加的代码:new_skillcategories是自定义实体,导入时报的错误是:名称:new_js_sendToOther.js  详细信息: 发生了错误,请重试此操作。

    我的资源文件的分别名称为:new_js_sendToOtherjs1C83C81A-7BB7-DF11-840E-00155DBA380F ,SycnIcon16x16pngD5D2EC98-666A-E011-B3F3-00155D011934,SycnIcon32x32pngD5D2EC98-666A-E011-B3F3-00155D011933   。这些id都是我自己写的,不知道是什么作用。

    <RibbonDiffXml>
        <!--修改成功-->
        <CustomActions>
        <CustomAction Id="Sample.new_skillcategories.grid.SendToOtherSystem.CustomAction"
               Location="Mscrm.HomepageGrid.new_skillcategories.MainTab.Collaborate.Controls._children"
               Sequence="41">
         <CommandUIDefinition>
          <Button Id="Sample.new_skillcategories.grid.SendToOtherSystem.Button"
              Command="Sample.new_skillcategories.grid.SendToOtherSystem.Command"
              LabelText="$LocLabels:Sample.new_skillcategories.SendToOtherSystem.LabelText"
              ToolTipTitle="$LocLabels:Sample.new_skillcategories.SendToOtherSystem.LabelText"
              ToolTipDescription="$LocLabels:Sample.new_skillcategories.SendToOtherSystem.ToolTip"
              TemplateAlias="o1"
              Image16by16="$webresource:SyncIcon16x16.png"
              Image32by32="$webresource:SyncIcon32x32.png" />
         </CommandUIDefinition>
        </CustomAction>
        <CustomAction Id="Sample.new_skillcategories.form.SendToOtherSystem.CustomAction"
               Location="Mscrm.Form.new_skillcategories.MainTab.Collaborate.Controls._children"
               Sequence="33">
         <CommandUIDefinition>
          <Button Id="Sample.new_skillcategories.form.SendToOtherSystem.Button"
              Command="Sample.new_skillcategories.form.SendToOtherSystem.Command"
              LabelText="$LocLabels:Sample.new_skillcategories.SendToOtherSystem.LabelText"
              ToolTipTitle="$LocLabels:Sample.new_skillcategories.SendToOtherSystem.LabelText"
              ToolTipDescription="$LocLabels:Sample.new_skillcategories.SendToOtherSystem.ToolTip"
              TemplateAlias="o1"
              Image16by16="$webresource:SyncIcon16x16.png"
              Image32by32="$webresource:SyncIcon32x32.png" />
         </CommandUIDefinition>
        </CustomAction>
        </CustomActions>
        <!--修改成功-->
        <Templates>
         <RibbonTemplates Id="Mscrm.Templates"></RibbonTemplates>
        </Templates>
                <!--修改的地方-->
                <CommandDefinitions>
                 <CommandDefinition Id="Sample.new_skillcategories.form.SendToOtherSystem.Command">
                  <EnableRules>
                   <EnableRule Id="Sample.new_skillcategories.WebClient.EnableRule" />
                   <EnableRule Id="Sample.new_skillcategories.form.NotNew.EnableRule"/>
                  </EnableRules>
                  <DisplayRules>
                   <DisplayRule Id="Sample.new_skillcategories.form.FormStateNotNew.DisplayRule" />
                   <DisplayRule Id="Sample.new_skillcategories.WebClient.DisplayRule" />
                  </DisplayRules>
                  <Actions>
                   <JavaScriptFunction Library="$webresource:new_SendToOtherSystem.js"
                             FunctionName="send" />
                  </Actions>
                 </CommandDefinition>
                 <CommandDefinition Id="Sample.new_skillcategories.grid.SendToOtherSystem.Command">
                  <EnableRules>
                   <EnableRule Id="Sample.new_skillcategories.WebClient.EnableRule" />
                   <EnableRule Id="Sample.new_skillcategories.grid.OneSelected.EnableRule"/>
                  </EnableRules>
                  <DisplayRules>
                   <DisplayRule Id="Sample.new_skillcategories.WebClient.DisplayRule" />
                  </DisplayRules>
                  <Actions>
                   <JavaScriptFunction Library="$webresource:new_SendToOtherSystem.js"
                             FunctionName="send" />
                  </Actions>
                 </CommandDefinition>
                </CommandDefinitions>
               <!--修改的地方-->
               <RuleDefinitions>
                       <!--修改的地方-->
                       <TabDisplayRules />
                       <DisplayRules>
                        <DisplayRule Id="Sample.new_skillcategories.form.FormStateNotNew.DisplayRule">
                         <FormStateRule State="Create"
                                 InvertResult="true" />
                        </DisplayRule>
                        <DisplayRule Id="Sample.new_skillcategories.WebClient.DisplayRule">
                         <CrmClientTypeRule Type="Web"/>
                        </DisplayRule>
                       </DisplayRules>
                       <EnableRules>
                        <EnableRule Id="Sample.new_skillcategories.WebClient.EnableRule">
                         <CrmClientTypeRule Type="Web" />
                        </EnableRule>
                        <EnableRule Id="Sample.new_skillcategories.form.NotNew.EnableRule">
                         <FormStateRule State="Create"
                                 InvertResult="true" />
                        </EnableRule>
                        <EnableRule Id="Sample.new_skillcategories.grid.OneSelected.EnableRule">
                         <SelectionCountRule AppliesTo="SelectedEntity"
                                   Maximum="1"
                                   Minimum="1" />
                        </EnableRule>
                       </EnableRules>
                      <!--修改的地方-->
               </RuleDefinitions>
               <!--修改的地方-->
                     <LocLabels>
                      <LocLabel Id="Sample.new_skillcategories.SendToOtherSystem.LabelText">
                       <Titles>
                        <Title languagecode="1033"
                            description="同步技能分类到外网" />
                       </Titles>
                      </LocLabel>
                      <LocLabel Id="Sample.new_skillcategories.SendToOtherSystem.ToolTip">
                       <Titles>
                        <Title languagecode="1033"
                            description="同步技能分类到外网" />
                       </Titles>
                      </LocLabel>
                     </LocLabels>
               <!--修改的地方-->
       </RibbonDiffXml>
    
    下面是资源相关的代码
    
    <pre lang="x-xml"><WebResources>
        <WebResource>
       <WebResourceId>{1c83c81a-7bb7-df11-840e-00155dba380f}</WebResourceId>
       <Name>new_js_sendToOther.js</Name>
       <DisplayName>js</DisplayName>
       <WebResourceType>3</WebResourceType>
       <IsCustomizable>1</IsCustomizable>
       <CanBeDeleted>1</CanBeDeleted>
       <IsHidden>0</IsHidden>
       <FileName>/WebResources/new_js_sendToOther1C83C81A-7BB7-DF11-840E-00155DBA380F</FileName>
      </WebResource>
      <WebResource>
       <WebResourceId>{D5D2EC98-666A-E011-B3F3-00155D011934}</WebResourceId>
       <Name>SycnIcon16x16.png</Name>
       <DisplayName>SycnIcon16x16.png</DisplayName>
       <Description>A 16x16 pixel icon showing a white 'X' on a red background.</Description>
       <WebResourceType>5</WebResourceType>
       <IsCustomizable>1</IsCustomizable>
       <CanBeDeleted>1</CanBeDeleted>
       <IsHidden>0</IsHidden>
       <FileName>/WebResources/SycnIcon16x16pngD5D2EC98-666A-E011-B3F3-00155D011934</FileName>
      </WebResource>
      <WebResource>
       <WebResourceId>{D5D2EC98-666A-E011-B3F3-00155D011933}</WebResourceId>
       <Name>SycnIcon32x32.png</Name>
       <DisplayName>SycnIcon32x32.png</DisplayName>
       <Description>A 32x32 pixel icon showing a white 'X' on a red background.</Description>
       <WebResourceType>5</WebResourceType>
       <IsCustomizable>1</IsCustomizable>
       <CanBeDeleted>1</CanBeDeleted>
       <IsHidden>0</IsHidden>
       <FileName>/WebResources/SycnIcon32x32pngD5D2EC98-666A-E011-B3F3-00155D011933</FileName>
      </WebResource>
     </WebResources>
    

    2011年5月10日 3:28

答案

  • <JavaScriptFunction Library="$webresource:new_SendToOtherSystem.js" FunctionName="send" />

    你的资源文件名是
    <Name>new_js_sendToOther.js</Name>

    不一致


    微软CRM
    2011年5月10日 7:09
    版主

全部回复