Hey,
Little problem, am doing i relate or unrelate with a combobox but it only update one item when i press the update button, what am i doing wrong:
Here is the code on the button - OnSelect
Set(loaderOn, true);
If(
Radio1.Selected.Value = "Remove",
ForAll(StoreCombo.SelectedItems, Unrelate(
MobGallery.Selected.StoreReferentials,
StoreCombo.Selected
)
),
ForAll(StoreCombo.SelectedItems, Relate(
MobGallery.Selected.StoreReferentials,
StoreCombo.Selected
)
)
);
Set(loaderOn, false)
That will not work, my big problem is i have a comboBox when selected it show the items from the relation and i would like to when i unselect its unrelate() but it will only unrelate what is selected
Hi @LoopinG2023 ,
It's not possible. Relate function only use for records that already exist in Dataverse tables. But if you can use LookUp function to get related records ForAll the collection, this can be done.
ForAll(
ForAll(
collection,
LookUp(DVtable, ....)
),
Relate(...)
)
Best regards,
Thanks, and may you know how to relate with a collection?
Hi @LoopinG2023 ,
Maybe you could try:
Set(loaderOn, true);
If(
Radio1.Selected.Value = "Remove",
ForAll(StoreCombo.SelectedItems, Unrelate(
MobGallery.Selected.StoreReferentials,
ThisRecord
)
),
ForAll(StoreCombo.SelectedItems, Relate(
MobGallery.Selected.StoreReferentials,
ThisRecord
)
)
);
Set(loaderOn, false)
Best regards,
WarrenBelz
146,524
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,906
Most Valuable Professional