I have a series of parent/child combo boxes in an edit form. After much struggle I finally got them to behave the way I want them too. Here is how this looks.
- When the parent is changed the child is set to blank
- If the parent is not changed the child shows the Parent.Default value if there is one.
Pretty simple. The problem is one of my child combo boxes is not behaving as the others. Here is an example of what currently have implemented for those that are working
Parent Combo Box
OnSelect
UpdateContext({varResetSubLedgerReview: false});
UpdateContext({varResetSubLedgerReview: true});
Child Combo Box
DefaultSelectedItems (This is where I made my change by rearranging the argument)
If(varResetSubLedgerReview,{Value: Blank()}, {dk_subledgername: Parent.Default})
Reset
Now, the only real difference between the child combo boxes that behave and the one that doesn't is this. The ones that work is that the Items property is being pulled from a data source like this
Sort(Filter('Cost Center Sub Ledgers', 'Cost Center Name' = CB_CostCenterReview.Selected.'Cost Center Name'), 'Sub Ledger Name', SortOrder.Ascending)
and the 'misbehaving' child combo box's Items property is hard coded like this
[1,2,3,4,5,6]
I know there is a value for Parent.Default for this 'misbehaving' child combo box. I've added a label to check
"(P)Email Sequence: " & DC_EmailSequenceNumberReview.Default
And rolling over the Parent.Default in the code below also gives me the value I expected.
If(varResetEmailSequenceReview,{Value:Blank()}, {dk_emailsequencenumber: Parent.Default})
Any ideas why it is not showing? The column type in the table is Text. The only thing I can think of is what I mentioned about how the Items property is set up.