web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested answer

Set ribbon button visible with Power Fx base specific form

(1) ShareShare
ReportReport
Posted on by 7

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!

I have the same question (0)
  • Suggested answer
    Abdul Wahab Profile Picture
    12,119 Moderator 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

  • sihoasks Profile Picture
    7 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
    limat Profile Picture
    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!

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
MVP-Daniyal Khaleel Profile Picture

MVP-Daniyal Khaleel 125

#2
Tom_Gioielli Profile Picture

Tom_Gioielli 121 Super User 2025 Season 2

#3
Erin Lubben Profile Picture

Erin Lubben 73

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans