You cannot add a record class property that can take any record structure and use RTTI to resolve the inner details of the record.
For this to work you have to use another way. A TValue
can be used with RTTI to resolve any type.
So declare:
tRTTI_Assistant = class (tObject)
private
//fSourceObject : tObject; // ! Use AnySource for objects as well
fAnySource : TValue;
...
//property SourceObject : tObject read fSourceObject write fSourceObject;
property AnySource: TValue read fAnySource write fAnySource;
...
end;
And call it:
myAssistant.AnySource := TValue.From(myRecord);
Now you can use RTTI for resolving not just record types, but any type.
See Convert Record to Serialized Form Data for sending via HTTP for examples how work with RTTI on a TValue
: