LookupColumns

I have problems  to get lookup fields to work. I have two Aureliusdatasets. This is the field definition:

...
 [Association([TAssociationProp.Lazy], [])]
    [JoinColumn('LicenseID', [], 'LicenseID')]
    [Description('')]
    FLicenseID: Proxy<TLicense>;
...

I can setup the lookupfield and find it both in the gridadapter as well as a column. But the dropdownlist does not show any data,only empty rows. I tried with both LookupKeyFields = Self as well as LicenseId.

Additionally I get a memoryleak for TTMSFNCGriddatabaseAdapterLookupItem

What am I missing?

Hi Bernd, could you provide more information. How are you retrieving data from both datasets (how they are configured), and how exactly is your Lookup Field being configured?

Here is how you should use it: 

http://www.tmssoftware.biz/business/aurelius/doc/web/lookup_fields.html
This is how the data is loaded:

procedure TmdStartup.DataModuleCreate(Sender: TObject);
begin
  Manager := TObjectManager.Create(TDBConnection.GetConnection);
  OpenBasedata;
  LoadAllData;
end;

procedure TmdStartup.LoadAllData;
var
  i: Integer;
begin
  adsSoftware.Close;
  Manager.Clear;
  FreeAndNil(ListOfSoftware);
  ListOfSoftware := Manager.Find<TSoftware>.List;
  adsSoftware.SetSourceList(ListOfSoftware);
  adsSoftware.Manager := Manager;
  adsSoftware.Open;
end;
procedure TmdStartup.OpenBasedata;
begin
  adsLicense.Close;
  Manager.Clear;
  FreeAndNil(ListOfLicense);
  ListOfLicense := Manager.Find<TLicense>.List;
  adsLicense.SetSourceList(ListOfLicense);
  adsLicense.Manager := Manager;
  adsLicense.Open;
end;

This is the definition of the lookup:

    object adsSoftwareLicenseDescription: TStringField
      FieldKind = fkLookup
      FieldName = 'LicenseDescription'
      LookupDataSet = adsLicense
      LookupKeyFields = 'Self'
      LookupResultField = 'Description'
      KeyFields = 'LicenseID'
      Lookup = True
    end


I?ve sent you a sample with steps to reproduce.

You were calling OpenBasedata, then LoadAllData. The Manager.Clear in LoadAllData was destroying the objects loaded in OpenBasedata, thus causing the Access Violation.

Ahh! Thanks for your excellent Support.