Skip to main content

Notifications

Dynamics 365 Community / Forums / Sales forum / Replace standard butto...
Sales forum
Suggested answer

Replace standard buttons on subgrid with modern command and add visibility rule

Posted on by 6
We are using quotes entity and have a related custom entity with sub grid visible to this entity on quote form.
We want to replace the standard "New" button in subgrid to open a custom page and add data in the related entity with a modern command "New" button, and show/ hide this button based on a field in quote record.
 
Unfortunately all blogs etc. are showing only how you can show/ hide buttons on the main grid/ main form, with conditions based on field values, but for this always a record must be selected/ opened.
Is there a way to have a visibility rule for subgrid? Something like: if field in quote abc_example = "Visible" than show "New" command in subgrid, else not.
 
We've tried everything, the enable rules (via command checker) always shows "false", so it seems that Self.Selected.Item... doesn't work for subgrid.
 
Any ideas? Ribbon Workbench could be a solution, but if there's a way to sue modern commands we would prefer this.
 
Thanks for any hints.
M.
Categories:
  • MacG Profile Picture
    MacG 6 on at
    Replace standard buttons on subgrid with modern command and add visibility rule
    Unfortunately this is not working (as expected). 
    If you add - as an example - the oob relation between Quote and Order (salesorder table) and add a modern command to the subgrid view of the order table (create new), everything is fine. New command is showing (without visibility rule).
     
    But trying to add also a visibility rule to this command, based on a value from the appropriate quote record (in this case its "parent"), leads to that the new command is always "hidden" (checked this also with the command checker/ "ribbon debug", but you can't figure out why the visibility rule always defaults to "false"). It seems that the check based on a "parent record value" is either basically not supported or I'm doing something wrong.
    I also can't find any documentations regarding this use case and every blog/ video to be found on the internet is always only showing the commands in the record itself. 
     
    The idea using this approach is to "connect" the new comand with a custom page, I used this approach several times since this is the easiest way to implement custom logic as this isn't really working in oob "quick creates" for us.
     
    Any additional ideas?
  • Suggested answer
    JeroenS Profile Picture
    JeroenS 42 on at
    Replace standard buttons on subgrid with modern command and add visibility rule
    Should you not be able to do this when following the next steps:
    - Open the app in App Designed and Edit
    - Select the right page
    - Select Edit Command Bar
    - Select the Subgrid view
    - make you changes using the Visible property?
     
  • MacG Profile Picture
    MacG 6 on at
    Replace standard buttons on subgrid with modern command and add visibility rule
    Hi VaHiX, thanks for the hint.
     
    I already found this article, but it requires ribbon workbench and we want to use the modern commands whereever possible.
     
    Reference the control context for primary and related tables EntityRule PrimaryEntity. SelectedEntity Self.Selected
     
    I tried this with several adjustments but without success. This shouldn't actually be an unusual requirement.
    Any ideas?  
     
    Thanks.
  • VaHiX Profile Picture
    VaHiX 995 on at
    Replace standard buttons on subgrid with modern command and add visibility rule

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

Dynamics 365 Community Update – Sep 16th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,462 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,366 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans