Hi all
I have a collection, allowing user to update all data then save all.
I use a ForAll to add or update all. However, the update only updates the first record with data from the last record.
Seems like ThisRecord.id is from first and .name is from last.
What is wrong here?
ForAll(palletList,
If(ThisRecord.id=Blank(),
Notify(Concatenate("Pallet add", ThisRecord.item),NotificationType.Success,500);
Patch(outbound_pallets, Defaults(outbound_pallets),
{ pallet_id: ThisRecord.pallet_id,
item: ThisRecord.item,
quantity: ThisRecord.quantity,
comment: ThisRecord.comment,
trip_id: tripList.Selected.id }),
// else
Notify(Concatenate("Pallet update ", ThisRecord.id, ",", ThisRecord.item, ",",ThisRecord.quantity),NotificationType.Error,500);
Patch([@outbound_pallets], LookUp(outbound_pallets, id=ThisRecord.id),
{ pallet_id: ThisRecord.pallet_id,
item: ThisRecord.item,
quantity: ThisRecord.quantity,
comment: ThisRecord.comment,
trip_id: tripList.Selected.id });
);
);