Skip to main content

Notifications

Customer experience | Sales, Customer Insights,...
Suggested answer

Set ribbon button visible with Power Fx base specific form

Posted on by 5

Hello Crm Community,

I am currently working on a ribbon button in the designer from microsoft and want to set my Ribbon button to visible when the user is working on a specific form. 

I just cant figure out how to get this working in the designer, because there is only the option to use Power Fx to set visible to true or false. 
I kinda tried every possible command in Power Fx and hoped that i could find a way to check if current form has a specific id or name.... But couldnt find a way to get it working.

Maybe i am missing something so i hope that you could help me out

I am not looking for a solution with the ribbon workbench in the xrm tool box hope for a explicit solution in the new designer with power fx. 

1004.image001.jpg

Thank you guys in advance!

  • Suggested answer
    limat Profile Picture
    limat 15 on at
    RE: Set ribbon button visible with Power Fx base specific form

    Hi sihoasks,

    can you try adding these below PowerFX  in the Visible property 

    1. if you want to show/hide ribbon button on the account form based on field values

    If(IsBlank(Self.Selected.Item.'fieldname'),true,false)

    2. if you want to show/hide ribbon button on main grid of account form (if at least one row of data is selected, button will be visible. Else, it will be invisible.)

    If(CountRows(Self.Selected.AllItems) > 0,true , false)

    Hope this will help you!

    Thanks!

  • sihoasks Profile Picture
    sihoasks 5 on at
    RE: Set ribbon button visible with Power Fx base specific form

    Hi Abdul thanks for your reply,

    well i know that it is possible with the ribbon workbench but still hoping that someone might know if i could handle that somehow with the command bar or if there are any news if it will be possible in future.

  • Suggested answer
    Abdul Wahab Profile Picture
    Abdul Wahab 12,070 Super User 2024 Season 1 on at
    RE: Set ribbon button visible with Power Fx base specific form

    Hi sihoasks,

    As per my very little knowledge, I do not think this is possible using the modern command bar. You can do it with the ribbon workbench and JS. 

    formItem = formContext.ui.formSelector.getCurrentItem(); 

    formItem.getId();

    For more details: learn.microsoft.com/.../formcontext-ui-formselector

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!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans