We have a requirement where we don’t want to display a Deck card if the Table inside the Deck doesn’t have any rows to display. The Deck is on Quotes and the Table inside the Deck runs on the Quoted Solution. A card shouldn’t be displayed for the Quotes that do not have any Quoted Solution. I am using the context condition of Quote Number. I have tried to use the same in the display logic for rendering but that doesn’t seem to work.
These cards should be displayed:
These cards shouldn’t be displayed:
Any hints on how can this be achieved?
There may be a better way, but if you create a model based on quotes solution that only returns the rows that appear in the cards, then add a condition to the quote model to only show rows who’s quote ID appear in the quote solution model, then a card would only be produced for Quotes with Quote Solutions. This may require you to make duplicate models that would slow down page load a bit but you probably won’t notice it unless you are loading in dozens/hundreds of rows
Hi @Skuidward_Tentacles, thank you for the assistance and apologies for not highlighting this earlier but my Deck will have seven different tables, each of them is associated with different model but all of the models are on Quoted Solution and have different model condition. I have tried your solution and it works well for one Table on Quoted Solution within the Deck on Quotes.
For each Quote in the Deck, seven different tables on Quoted Solutions should be displayed only if each of them have atleast one row. So if 3 out of the 7 tables have rows, then only three tables should be displayed for that Quote. Is there any way to implement this, I was thinking to add something for the Display logic condition on the tables but couldn’t find anything
Try nested deck components with context based on aggregate model versions of your Quote solutions models. So wrap each one of your tables in a deck component on an aggregate model version of the corresponding quote solution model grouped by Quote so that the nested deck only shows one row for each quote that has quote solutions in that model. Then set the context of the nested decks so that the ID of the quote in the parent deck equals the quote ID (Parent) of the Quote Solutions in the child deck.
This should only show a card in the deck if the quote has quote solutions. If it doesn’t display the card, then the table won’t be displayed.
@Skuidward_Tentacles Thank you so much, this is exactly what I am looking for, the only drawback here is that it would require 14 models on the page (7 Basic and 7 Aggregate).
Is there any way to lessen the number of models? I am using seven models on Quoted Solution, the only difference is that they bring different records into the model based on the value of a picklist field. I want to display the records from each model in separate tables.
Maybe add an additional grouping to your agg models based on the values of your picklist field so that each nested deck would contain up to 7 cards based on the 7 picklist options. Then nest a third layer deck to set the context of the picklist value. Then you may only need a single regular model on your solution object instead of 7 because the conditioning for the picklist would be done by the context of the grandchild nested deck?
@Skuidward_Tentacles I think I would need 7 Basic models because I also need to show field values from the Quoted Solution object as Table columns. I can’t seem to fetch them in Aggregate models.