Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Dync 365 Ribbon Button Enable Rules - Possible Bug - Regression

Posted on by Microsoft Employee

Hi All ,

I have a 2 custom button which are mutually exclusive. So only one button shoudl appear at a time depending on an optionSet Value in the Form . 

So Enable rule 1 :   Field="X" Value="0"  InvertResult="false"

Enable rule 1 :   Field="X" Value="0" InvertResult="true"  .

This is not working anymore on Dync 365 ( 8.2)

After some checkings , i decided to check if this is a bug by trying to replicate this in a Vanilla trial installation.

So i chose the opportunity Form , created 2 buttons as described :

- one button is displayed when the "Purchase Process" (option Set Field) = 0 (Individual)

   second button is displayed when the "Purchase Process" (option Set Field) != 0 (all other possible values).

Here's the  Ribbon xml Diff

<?xml version="1.0" encoding="utf-16"?>
<RibbonDiffXml xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <CustomActions>
    <CustomAction Id="cla.opportunity.Reverse.Button.CustomAction" Location="Mscrm.Form.opportunity.MainTab.Save.Controls._children" Sequence="85">
      <CommandUIDefinition>
        <Button Alt="$LocLabels:cla.opportunity.Reverse.Button.Alt" Command="cla.opportunity.Reverse.Command" Id="cla.opportunity.Reverse.Button" LabelText="$LocLabels:cla.opportunity.Reverse.Button.LabelText" Sequence="85" TemplateAlias="o2" ToolTipTitle="$LocLabels:cla.opportunity.Reverse.Button.ToolTipTitle" ToolTipDescription="$LocLabels:cla.opportunity.Reverse.Button.ToolTipDescription" />
      </CommandUIDefinition>
    </CustomAction>
    <CustomAction Id="cla.opportunity.Value.Button.CustomAction" Location="Mscrm.Form.opportunity.MainTab.Save.Controls._children" Sequence="95">
      <CommandUIDefinition>
        <Button Alt="$LocLabels:cla.opportunity.Value.Button.Alt" Command="cla.opportunity.Value.Command" Id="cla.opportunity.Value.Button" LabelText="$LocLabels:cla.opportunity.Value.Button.LabelText" Sequence="95" TemplateAlias="isv" ToolTipTitle="$LocLabels:cla.opportunity.Value.Button.ToolTipTitle" ToolTipDescription="$LocLabels:cla.opportunity.Value.Button.ToolTipDescription" />
      </CommandUIDefinition>
    </CustomAction>
  </CustomActions>
  <Templates>
    <RibbonTemplates Id="Mscrm.Templates" />
  </Templates>
  <CommandDefinitions>
    <CommandDefinition Id="cla.opportunity.Reverse.Command">
      <EnableRules>
        <EnableRule Id="cla.opportunity.Reverse.EnableRule" />
      </EnableRules>
      <DisplayRules />
      <Actions>
        <Url Address="https://www.microsoft.com" WinMode="0" PassParams="false" />
      </Actions>
    </CommandDefinition>
    <CommandDefinition Id="cla.opportunity.Value.Command">
      <EnableRules>
        <EnableRule Id="cla.opportunity.Value.EnableRule" />
      </EnableRules>
      <DisplayRules />
      <Actions>
        <Url Address="https://www.microsoft.com" WinMode="0" PassParams="false" />
      </Actions>
    </CommandDefinition>
  </CommandDefinitions>
  <RuleDefinitions>
    <TabDisplayRules />
    <DisplayRules />
    <EnableRules>
      <EnableRule Id="cla.opportunity.Reverse.EnableRule">
        <ValueRule Field="purchaseprocess" Value="0" Default="true" InvertResult="true" />
      </EnableRule>
      <EnableRule Id="cla.opportunity.Value.EnableRule">
        <ValueRule Field="purchaseprocess" Value="0" Default="false" InvertResult="false" />
      </EnableRule>
    </EnableRules>
  </RuleDefinitions>
  <LocLabels>
    <LocLabel Id="cla.opportunity.Reverse.Button.LabelText">
      <Titles>
        <Title description="Reverse" languagecode="1033" />
      </Titles>
    </LocLabel>
    <LocLabel Id="cla.opportunity.Reverse.Button.ToolTipTitle">
      <Titles>
        <Title description="Reverse" languagecode="1033" />
      </Titles>
    </LocLabel>
    <LocLabel Id="cla.opportunity.Reverse.Button.ToolTipDescription">
      <Titles>
        <Title description="Reverse" languagecode="1033" />
      </Titles>
    </LocLabel>
    <LocLabel Id="cla.opportunity.Reverse.Button.Alt">
      <Titles>
        <Title description="Reverse" languagecode="1033" />
      </Titles>
    </LocLabel>
    <LocLabel Id="cla.opportunity.Value.Button.LabelText">
      <Titles>
        <Title description="Value" languagecode="1033" />
      </Titles>
    </LocLabel>
    <LocLabel Id="cla.opportunity.Value.Button.ToolTipTitle">
      <Titles>
        <Title description="Value" languagecode="1033" />
      </Titles>
    </LocLabel>
    <LocLabel Id="cla.opportunity.Value.Button.ToolTipDescription">
      <Titles>
        <Title description="Value" languagecode="1033" />
      </Titles>
    </LocLabel>
    <LocLabel Id="cla.opportunity.Value.Button.Alt">
      <Titles>
        <Title description="Value" languagecode="1033" />
      </Titles>
    </LocLabel>
  </LocLabels>
</RibbonDiffXml>

Regards,


  

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Dync 365 Ribbon Button Enable Rules - Possible Bug - Regression

    Thank you Scott , for your response . Howver this is not working for me : Nor the value , neither the Text Label .

    Can i trace any probelm with the ribbon , becuse i don't get any warnings or errors.

    I can't locate the problem. Please advise.

    as i mentionned it was working fine with Dync 2015 , 2016 online but for some reason it's not working for Dync 365 online ?

  • ScottDurow Profile Picture
    ScottDurow 50,177 on at
    RE: Dync 365 Ribbon Button Enable Rules - Possible Bug - Regression

    There is an ongoing issue with this in that it seems that you need to provide the text label value of the optionset in some situations - can you give that a go?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans