locked
Error in add custom button in crm 2013 RRS feed

  • Question

  • Hi,

    I want to add custom button on entity form ribbon in crm 2013. I have an entity name "MyCustomEntity" and a javascript name"new_HelloWorld" and its function name "HelloWorld".

    I have export solution and want to customize xml file. Now please tell how to add a button by edit xml file and call function when button is clicked.

      <RibbonDiffXml>
            <CustomActions />
            <Templates>
              <RibbonTemplates Id="Mscrm.Templates"></RibbonTemplates>
            </Templates>
            <CommandDefinitions />
            <RuleDefinitions>
              <TabDisplayRules />
              <DisplayRules />
              <EnableRules />
            </RuleDefinitions>
            <LocLabels />
          </RibbonDiffXml>

    Monday, April 21, 2014 12:53 PM

All replies

  • Monday, April 21, 2014 1:00 PM
    Moderator
  • i used this tool for adding a button on ribbon but button is not visible on ribbon kindly help

    here is xml code which is generated by tool

    <?xml version="1.0" encoding="utf-16"?>
    <RibbonDiffXml xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <CustomActions>
        <CustomAction Id="new.new_customentity.Button1.Button.CustomAction" Location="Mscrm.Form.new_customentity.MainTab.Save.Controls._children" Sequence="80">
          <CommandUIDefinition>
            <Button Id="new.new_customentity.Button1.Button" LabelText="$LocLabels:new.new_customentity.Button1.Button.LabelText" Sequence="80" TemplateAlias="o2" />
          </CommandUIDefinition>
        </CustomAction>
      </CustomActions>
      <Templates>
        <RibbonTemplates Id="Mscrm.Templates" />
      </Templates>
      <CommandDefinitions>
        <CommandDefinition Id="new.new_customentity.Command0.Command">
          <EnableRules />
          <DisplayRules />
          <Actions>
            <JavaScriptFunction FunctionName="HelloWorld" Library="$webresource:new_HelloWorld" />
          </Actions>
        </CommandDefinition>
      </CommandDefinitions>
      <RuleDefinitions>
        <TabDisplayRules />
        <DisplayRules />
        <EnableRules />
      </RuleDefinitions>
      <LocLabels>
        <LocLabel Id="new.new_customentity.Button1.Button.LabelText">
          <Titles>
            <Title description="Button" languagecode="1033" />
          </Titles>
        </LocLabel>
      </LocLabels>
    </RibbonDiffXml>

    Monday, April 21, 2014 1:28 PM