Hello,
I am working on a supply ordering app where products and quantities are selected and added to a collection (colOrderItems) and an order contact plus any comments are collected via an edit form. I need to patch all of the order data- products ordered, their quantities, order contact, and any comments. Ideally, the records would be created with the same ID but different Product Ordered and Quantity values for every item selected. I currently have the following code in the OnSelect property of my submit button:
SubmitForm(Form2_1);
ForAll(
colOrderItems,
Patch( Order,
First(Sort(Order, Modified, Descending)),
{
'Order Contact': DataCardValue9_1.Selected,
ID: Value(ThisRecord.ID),
'Order Contact': ThisRecord.'Order Contact',
'Product Ordered': ThisRecord.'Product Ordered',
Quantity: ThisRecord.Quantity,
'Special Request': ThisRecord.'Special Request',
SupplyID: ThisRecord.SupplyID
}
)
);
When the form is submitted, a record is created containing the order contact, special request/comments, and ID. My assumption was that I would need to edit that record and patch the data for every item in the collection. However, I have tried reconfiguring many different ways and "the patch function has some invalid arguments" error persists.