Howdy All,
I am trying to update a Many-To-Many relationship using a Combo Box in a form.
This code seems to Unrelate all of the items in first table and then Related all items in the second table.
// Update Applications for Producing Information Flows
UpdateContext({tblIteration:InformationFlowGallery.Selected.'Applications (cr182_ProducingApplication)'});
UpdateContext({tblIteration2:DataCardValue36.SelectedItems});
Notify(Concatenate("I1 = ", CountRows(tblIteration)," I2 = ", CountRows(tblIteration2)), Information, 3000);
// Remove Dropped Apps
ForAll(tblIteration,
If(
Not(ThisRecord exactin tblIteration2),
Unrelate(InformationFlowGallery.Selected.'Applications (cr182_ProducingApplication)', ThisRecord); Notify("Unrelated", Information,1000)
)
);
// Include New Producing Apps
ForAll(
tblIteration2,
If(
Not(ThisRecord exactin tblIteration),
Relate(InformationFlowGallery.Selected.'Applications (cr182_ProducingApplication)', ThisRecord); Notify("Related", Information, 1000)
)
);
My hope was that it would unrelate items that in the many-to-many relationship but not in the updated combo-box selection and relate records in the updated combo-box selection but not in the many-to-many relationship.
I've tried with "in" and "exactin" and seems to behave similarly, i.e. both unrelate all records and then relate all records.
Thanks in advance for any suggestions.
Cheers,
Ashley.

Report
All responses (
Answers (