Link detailentity to masterentitiy OnNewRecord


I have something like following sqlite db
I am using TAureliusDataset and TAureliusManager.

tblStudent.id
tblIssue.studentid  

tblIssue.OnNewRecord I want to set 
studentid to tblStudent.id

However in my entities.pas file tblIssue.studentid is defined as
studentid :ttblIssue 

Of course this doesn't work since at the entities level tblissue.studentid is of type ttblStudent.
procedure TfrmIssues.dsetIssueNewRecord(DataSet: TDataSet);
begin
  Dataset.FieldByName('studentid').AsInteger := tblStudent.id;
end;

I don't understand how to set the id of the master record into the detail record the Aurelius entities way.  

Hello Jon, do this:




procedure TfrmIssues.dsetIssueNewRecord(DataSet: TDataSet);
begin
  Dataset.EntityFieldByName('studentid').AsObject := tblStudent.Current<TTblIssue>;
end;