Skip to main content

Notifications

Announcements

No record found.

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

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

Posted on by 22
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.
  • MacG Profile Picture
    MacG 22 on at
    Replace standard buttons on subgrid with modern command and add visibility rule
    **Push**
     
    Unfortunately it's still not answered, issue remains.
    Is there really nobody who tried this and has an idea how to do it without ribbon workbench?
     
    Every blog/ video to be found on the internet is always showing "commanding" in the main form and not in sub-grids, also MS links provided in below posts.
    Anything that lead into the right direction would be highly appreciated.
     
    Thanks.
  • VaHiX Profile Picture
    VaHiX 3,053 on at
    Replace standard buttons on subgrid with modern command and add visibility rule
     

    ** Please don't forget to close up the thread here by Like and verify it as an answer if it was solved **

  • MacG Profile Picture
    MacG 22 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 46 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 22 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 3,053 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

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