Hi All,
I have an app that is used to quote parts my company produces. In the app, a user can save their quote and reopen it later - I achieve this by saving collections to a data table, and then re-loading the collection from the table inside the app. Where I could use some help is:
It's easy to load & save collections to a table, but is there an easy way to prevent saving an item if it is already present in the table? I grab the objects ID when loading them into a collection, so I am wondering if I can use that ID to prevent patching a row to my DataSource if it detects that ID in said data source. I can provide my code below.
Save: ForAll(colConnectors, Patch( 'Wire Harness Connector Collections', Defaults('Wire Harness Connector Collections'),
{ 'Quote #': TextInput6_2.Text,
ConnectorName: ThisRecord.ConnectorName,
Cost: ThisRecord.Cost,
Family: ThisRecord.Family,
Image: ThisRecord.Image,
'Part #': ThisRecord.PartNumber,
'Terminal Qty': ThisRecord.TerminalQty,
'Wire Qty': ThisRecord.WireQty}))
Load: ClearCollect(
colConnectorsEdit,
Filter(
'Wire Harness Connector Collections',
'Quote #' = Gallery2.Selected.Result))
Does anyone have a suggestion for how I can prevent patching records that already exist in the table if I create another save button for quotes that have been loaded into my app?