@wp ... IMHO, still some pending fixes in vpflxds.pas !
First.
Line 1113: FN := GetFieldName(FEventMappings, 'ResourceID');
Here, the fieldmapping for ResourceID is looked up in EventMappings.
But, in the next line: if (FN <> '') and FResourceDataSrc.DataSet.Locate(FN, Resource.ResourceID, [])
this mapping is used to locate something in the resource dataset, that should have used its own mapping.
Correct line 1113: RFN := GetFieldName(FResourceMappings, 'ResourceID');
Same valid for:
Line 1539
Second
The code in function TVpFlexDataStore.GetFieldName is not that ok IMHO
result := '';
if Mappings.Count = 0 then
Result := VpField
else
The above means that, even if you only want to map a single field, you have to map all fields !!
Lost of works and lots of CPU cycles !
I would do:
result := VpField;
if Mappings.Count > 0 then
begin
Again, see my previous commit (vpflxds.pas ) :
https://github.com/LongDirtyAnimAlf/mORMotPlanIt/commit/09e43e2ea2c4473d8d5ae6502f077aaae1e9d387