Set value of checkbox in a Gallery Item with ForAll
I have been battling with this problem for a day with no success so far. I'll put my problem into context:
- I have created two entities in the CDS named "Task" and "Task template". Their relation is Many to Many, so different tasks can belong to the same template, and different templates can reference the same task.
- I have created a combox box that displays the name of the template, and I have created a Gallery listing the Tasks.. I have inserted a checkbox to the gallery.
My goal is that when clicking a button called "Add template", the checkbox of the corresponding task is set to true (later on I want to use this checkbox to know what tasks I have to include in another table entity).
So, the code of the "Add template" button is the following:
Hi v-siky-msft, thank you again for your response.
I tried the solution you gave me, but I can't use "TemplateCombo.Selected.Value". The "Value" part throws an error because it doesn't appear in the displayed selectable fields. What is "Value" exactly? I get that TemplateCombo.Selected is the whole register (row) and I can select a field like TemplateCombo.Selected.FieldX, but I don't get what Value can be.
However, I could tweak it a little bit, and in the end I did the following: