Show/Hide Toolbars

TMS Aurelius Documentation

You can access properties of associated objects (sub-properties) through TAureliusDataset. Suppose you have a class like this:

 

  TCustomer = class

  // <snip>

  public

    property Id: Integer read FId write FId;

    property Name: string read FName write FName;

    property Country: TCountry read FCountry write FCountry;

  end;

 

You can access properties of Country object using dots:

 

AureliusDataset1.FieldByName('Country.Name').AsString := 'Germany';

 

As you might have noticed, sub-property fields can not only be read, but also written to. There is not a limit for level access, which means you can have fields like this:

 

CountryName := AureliusDataset1.FieldByName('Invoice.Customer.Country.Name').AsString;

 

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. Just like any other TDataset, you do that at design-time, or at runtime:

 

with TStringField.Create(Self) do

begin

  FieldName := 'Country.Name';

  Dataset := AureliusDataset1;

end;