This documentation here:
Modify or create a set of records in a data source
Patch( DataSource, BaseRecordsTable, ChageRecordTable1, [, ChangeRecordTable2, … ] )
DataSource – Required. The data source that contains the records that you want to modify or will contain the records that you want to create.
BaseRecordTable – Required. A table of records to modify or create. If the record came from a data source, the record is found and modified. If the result of Defaults is used, a record is created.
ChangeRecordTable(s) – Required. One or more tables of records that contain properties to modify for each record of the BaseRecordTable. Change records are processed in order from the beginning of the argument list to the end, with later property values overriding earlier ones.
I have 4 columns: ID, Name, FieldType, Active
I am not ADDING any records, only updating records.
When user toggle Active, I'm trying to add that item to a collection, like so:
Collect(EditedRows3, {ID: ThisItem.ID,Active: ThisItem.Active, FieldType: ThisItem.FieldType, Name: ThisItem.Name})
Then on the save button, I do this:
Patch('[dbo].[SnapShotFields]',EditedRows3);
Clear(EditedRows3)
but when running the Patch command, I am getting error message FieldType: Field Required
Every item I have has a field type already set, and it's included in the collection. Any suggestions what I am doing wrong?
Thanks
Solved! Go to Solution.
Try this:
Patch('[dbo].[SnapShotFields]', ShowColumns(EditedRows3, "ID"), EditedRows3)
This is because you need the second parameter to identify which records need to be modified.
I am assuming that ID is the primary key of your table.
Please let me know
Try this:
Patch('[dbo].[SnapShotFields]', ShowColumns(EditedRows3, "ID"), EditedRows3)
This is because you need the second parameter to identify which records need to be modified.
I am assuming that ID is the primary key of your table.
Please let me know
Thanks so much!
You are welcome, please visit my blog:
User | Count |
---|---|
141 | |
137 | |
78 | |
77 | |
72 |
User | Count |
---|---|
228 | |
178 | |
68 | |
68 | |
58 |