// 1. Create parent order and get its ID
Set(
varRecordID,
Patch(
'Shopping Cart / Order Remarks',
Defaults('Shopping Cart / Order Remarks'),
{
Title: If(Remarks.Selected.Value="Others", OthersComments.Text, Remarks.Selected.Value),
User: FullName.Text
}
).ID
);
// 2. Clear previous failed items log
Clear(c_FailedItems);
// 3. Patch each item in Cart with error handling (modern As syntax)
ForAll(
c_Cart As _obj,
If(
!IsError(
Patch(
'Shopping Cart / Checkout',
Defaults('Shopping Cart / Checkout'),
{
'Name (Title)': _obj.Name,
Image: _obj.Image,
Unit: _obj.Unit,
Date: DateTimeValue(_obj.Date),
Quantity: _obj.Quantity,
OrderID: varRecordID,
Remarks: If(_obj.Remarks.Selected.Value="Others", _obj.OthersComments.Text, _obj.Remarks.Selected.Value)
}
)
),
true, // success, do nothing
Collect(c_FailedItems, _obj) // log failed items
)
);
// 4. Notify user if any failures
If(
CountRows(c_FailedItems) > 0,
Notify("Some items failed to save. Please retry.", NotificationType.Error),
Notify("All items saved successfully!", NotificationType.Success)
);
// 5. Reset form and collection
Reset(Remarks);
Reset(OthersComments);
Clear(c_Cart);
Navigate('Successful Place Order', ScreenTransition.Cover);
![]()
![Click and drag to move]()
📩 Need more help? Mention
@CU19111247-0 anytime!
✔️ Don’t forget to Accept as Solution if this guidance worked for you.
💛 Your Like motivates me to keep helping!