locked
CRM 2011: Custom Ribbon Button on Form not displaying. RRS feed

  • Question

  • Hello, 

    I am having troubles determining why the customization for the ribbon is not displaying. Essentially I want a custom button on the ribbon. 

    Here is what I have for the Customization.

    <RibbonDiffXml> <CustomActions> <CustomAction Id="Mscrm.Form.salesorderdetail.TestResult.CustomAction" Location="Mscrm.Form.salesorderdetail.MainTab.Save.Controls._children"> <CommandUIDefinition> <Button Id="Mscrm.Form.salesorderdetail.TestResult.Button" Command="Mscrm.Form.salesorderdetail.TestResult.Command" LabelText="Test Results" /> </CommandUIDefinition> </CustomAction> </CustomActions> <Templates> <RibbonTemplates Id="Mscrm.Templates"></RibbonTemplates> </Templates> <CommandDefinitions> <CommandDefinition Id="Mscrm.Form.salesorderdetail.TestResult.Command"> <EnableRules> <EnableRule Id="Mscrm.EnableRule.ShowResult" /> </EnableRules> <DisplayRules /> <Actions> <JavaScriptFunction FunctionName="showTestResults" Library="$webresource:new_popUpTestResults" /> </Actions> </CommandDefinition> </CommandDefinitions> <RuleDefinitions>

              <TabDisplayRules />
              <DisplayRules>
    <DisplayRule Id="Mscrm.DisplayRule.ShowResult">
    <FormStateRule State="Create" InvertResult="true" />
    </DisplayRule>
     </DisplayRules>
              <EnableRules>
    <EnableRule Id="Mscrm.EnableRule.ShowResult">
    <FormStateRule State="Existing" />
    </EnableRule>
     </EnableRules>
            </RuleDefinitions>
            <LocLabels />
          </RibbonDiffXml>


    I am able to import the solution successfully. 

    When I created the new solution, I picked specifically for salesorderdetail, since this is where I want the button to display.

    Thanks, please let me know if there is any misunderstanding in the question. 



    • Edited by aTruong.xrm Wednesday, September 24, 2014 5:49 PM
    Wednesday, September 24, 2014 3:05 PM

All replies

  • Hi,

    Please use Ribbon Workbench for adding button. If you are still not able to see your button try to add your button in custom group.

    Thanks!

    Wednesday, September 24, 2014 6:13 PM
  • Hi,

    Please use the code below:

    <RibbonDiffXml>
            <CustomActions>
    			<CustomAction Id="MS.Form.salesorderdetail.MainTab.Save.CustomAction"
    				Location="Mscrm.Form.salesorderdetail.MainTab.Save.Controls._children">
    				<CommandUIDefinition>
    					<Button Id="Mscrm.Form.salesorderdetail.TestResult"
    							Command="Mscrm.Form.salesorderdetail.TestResult.Command"
    							LabelText="Test Results" />
    				</CommandUIDefinition>
    			</CustomAction>
    		</CustomActions>
            <Templates>
              <RibbonTemplates Id="Mscrm.Templates"></RibbonTemplates>
            </Templates>
            <CommandDefinitions>
    			<CommandDefinition Id="Mscrm.Form.salesorderdetail.TestResult.Command">				
    				<EnableRules>
    					<EnableRule Id="Mscrm.EnableRule.ShowResult" />
    				</EnableRules>
    				<DisplayRules />
    				<Actions>
    					<JavaScriptFunction FunctionName="showTestResults" Library="$webresource:new_popUpTestResults" />
    				</Actions>
    			</CommandDefinition>
    		</CommandDefinitions>
            <RuleDefinitions>          <TabDisplayRules />
              <DisplayRules>
    			<DisplayRule Id="Mscrm.DisplayRule.ShowResult">
    				<FormStateRule State="Create" InvertResult="true" />
    			</DisplayRule>
    		  </DisplayRules>
              <EnableRules>
    			<EnableRule Id="Mscrm.EnableRule.ShowResult">
    				<FormStateRule State="Existing" />
    			</EnableRule>
    		  </EnableRules>
            </RuleDefinitions>
            <LocLabels />
          </RibbonDiffXml>
    Saad

    Thursday, September 25, 2014 10:15 AM
  • Hi,

    Are you doing your customization from Chrome. If yes please check your version, If it is v37 most of the customizations will not work. Better use IE.

    Thank you,



    Sreeni Pavalla

    Thursday, September 25, 2014 11:43 AM