Hi
I am facing an issue while editing command bar. I am trying to add a power FX expression on a button visibility formula. I want to pick an option set value and cehck what option is selected and based upon that will hide/show the button below is my expression
One thing to check is whether the global option set has any inactive options. Inactive options are not visible in the Power FX expression editor by default, so you may need to enable them to see all the options. To do this, follow these steps:
Open the global option set definition in the Dynamics 365 solution.
In the "Options" tab, click the "View" button in the ribbon.
In the dropdown, select "Inactive options".
Any inactive options will now be visible. Make a note of the exact spelling and capitalization of the option set values you want to use in your expression.
Another thing to check is the syntax of your expression. It looks like you are using a dot notation to reference the option set values, but this is not the correct syntax for Power FX. Instead, you should use square brackets to reference the option set values. Here is the corrected expression:
If(Self.Selected.Item.Status = 'Status (Notifications)'.Inactive && Self.Selected.Item.Notificationtype <> [Optionsetvalues], true, false)
In this expression, the square brackets around "Optionsetvalues" indicate that it is a reference to the option set values in the global option set.
Hopefully this helps you to fix the issue and set the visibility of your button based on the value of the global option set field.
We had the same problem today. I edited the same formula in the "Component Library" by using the "Open component library" button and all my option set values were visible there. After saving, the original command bar editor window works as expected again.
I can see all the options.
It seems to refresh, cache, publish or have syntax (check above if this is the case) issues.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156