I have the following calls inside an OnSelect method of a button, I am trying to update a number of records first (old ones which are Active), to Inactive.
I then want to create a number of new records based on the collection I have created from a gallery.
The trouble is when I have just the UpdateIf statement in the event call, the old records update ok.
However, if I add the final part (ForAll - new record creation), the update doesn't fire for the old records?
Any ideas?
Clear(clItems);
ForAll(
glrQuestions.AllItems,
Collect(
clItems,
{
Answer: txtAnwer.Text
}
)
);
UpdateIf(
Answers,
Status = 'Status (Answers)'.Active,
{
statecode: 'Status (Answers)'.Inactive,
statuscode: 'Status Reason (Answers)'.Inactive
}
);
ForAll(
clItems,
Patch(
Answers,
Defaults(Answers),
{
new_answer: clItems[@Answer]
}
)
);