I have an app that is supposed to write into SQL tables from data in 2 collections using ForAll Patch functions. Below is the OnSelect statement for my submit button. It was working until recently when I began getting errors for the first ForAll function (second ForAll is still working correctly). Sometimes it patches all rows fine, sometimes it patches a few rows and misses a few rows, and other times all rows fail. It shows as a runtime error saying "Field 'CHECKBOOK_ID' is required" but I can see that this field is populated for all rows in the collection before I hit submit. Any suggestions would be greatly appreciated.
ForAll(CashReceipts,Patch('[dbo].[CLAIMED_PAYMENTS]',Defaults('[dbo].[CLAIMED_PAYMENTS]'),{CUSTOMER_ID:CustomerID,CURRENCY_ID:CurrencyID,CLAIMED_AMOUNT:Value(Amount),CHECKBOOK_ID:CheckbookID,Payment_Purpose:PaymentPurpose,Qty_Orders_Processed:Value(OrderQty),Date_Orders_Processed:OrderDate,Month_Year_Fees:MonthlyFees,Additional_Info:AdditionalInfo,Payment_ID:PaymentID}));ForAll(OMSIAdjustments,Patch('[dbo].[OMSI_ADJUSTMENTS]',Defaults('[dbo].[OMSI_ADJUSTMENTS]'),{OMSI_CLIENT:OMSIClient,OMSI_PROGRAM_LEDGER:OMSIProgram,OMSI_PRODUCT:OMSIProduct,OMSI_ACCOUNT_TYPE:OMSIAccountType,Add_Remove:AddRemove,OMSI_Amount:Value(OMSIAmount),CUSTOMER_ID:OMSICustomerID,PAYMENT_ID:PaymentID}));Patch('[dbo].[PAYMENTS]',First(Filter('[dbo].[PAYMENTS]',PAYMENT_ID = ThisItemID.PAYMENT_ID)),{Claimed:Today()});Navigate(PaymentsReceived_Screen,ScreenTransition.None)