Is it possible to add “default row” when Drawer child table have no records for corresponding Account record in List view?
Hi!
You might be able to do this using render conditions. Here’s one approach:
- Have a roll up summary on parent counting the number of child records
- Add a row action with ‘run multiple actions’ to your account table with a render condition that only displays the row action if the roll up summary count = 0. Add an additional action which creates a new row on your child model.
- Add a second row action to your account table with a render condition that only displays if the rollup summary count is greater than 0. Set this to just show your standard list without adding a new row to the model.
You may have to use separate models for the two row actions.
Forgive me if I misunderstood!
Thanks for your reply
Your understanding is correct. But I need to add the new row in Drawer expand action itself.
For Example,
I have the Account records in list view with Drawer table for child Contact records. When I click the button to expand the drawer, If a Account doesn’t have any child contacts, I need to show the input fields of contacts in drawer action.
Louis’ idea is great! You could use javascript but one roll up with conditional rendering is easier to understand and implement. You can get what you want. Both row actions should open the drawer. One does just this. The other has an additional action to add a row to the model used to used to display records in the component in the drawer. You’ll only have to set the default value of the required reference field to ensure it gets into your drawer.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.