I am revisiting this and figured I'd try and lay out the situation again and see if we can come up with a good strategy,
Here is my situation
- I have a gallery that returns records from Dataverse table
- When you select a gallery item the record is written to a global variable (I used a global variable because there is also a copy record function on the page that navigates the users back to the original form and populates it with the copied record for editing)
- I have a form on the page that uses the global variable data as the Items property
- In the form I have some dependent combo boxes. These function as expected. When and item from the parent is selected the values available in the child combo box are changed.
This all works fine. But I am having issues with the behavior I want the child combo boxes to have. Here is what I want to happen.
- When a parent combo box is changed I want the child combo box(es) to appear blank.
- If the child combo box is required I want that to be respected by the form
My issue has been how to get this to work. Here is what I have tried.
- For the parent combo box I am setting the OnSelect property to a context variable
UpdateContext({varResetSubLedgerReview: true});
- I set the Reset property of the child to this value
varResetSubLedgerReview
- The DefaultSelectedItems for the child combo box is
{Value:If(varResetSubLedgerReview,Blank(), Parent.Default)}
This works the first time around but fails if I were to change the parent combo box again since the variable is still set to true.
I've tried setting the variable back to false using the OnSelect of the child combo box. That does work to reset the variable, but the side effect is that the logic in the DefaultSelectedItems, for the child, fails. Instead of the blank remaining it is replaced with the Parent.Default. Any thoughts on what needs to be done here? Maybe I need a second variable?