It's important to note that sub-property fields are not created by default when using default fields. In the example of TCustomer class above, only field "Country" will be created by default, but not "Country.Name" or any of its sub-properties. To use a sub-property field, you must manually add the field to the dataset before opening it.
I believe there's also a DataSet property to specify how many levels you want to import when reading FieldDefs.
Also make sure the Supplier (level 2 property) exists. Perhaps you need to do something like this first:
TLot_In.Supplier.AsObject := TSupplier.Create;
Otherwise the Supplier property is nil and you cannot set its properties.
Apologies if I’m stating the obvious, but sometimes that’s required . I just struggled with an XData Server, only to find out I accidentally had an illegal fieldname for SQL Server….
I notice the name of field in the error message (supplier) is not the same of that the dataset has created (doc.supplier). could this be a clue? What the synsubprops property does?
Perhaps the dot in then name of field (doc.supplier) is a problem
Don't apologize. Sometimes we make trivial mistakes.
Allows automatic updating of associated fields. When an entity field (e.g., "Customer") of the TAureliusDataset component is modified, all the subproperty fields (e.g., "Customer.Name", "Customer.Birthday") will be automatically updated with new values if this property is set to True. Default is False.