sql triggers primary and foreign keys HELP

I am just looking at converting a paradox system to Interbase and have
this problem.
I have a four tables in master-detail form. I have just got triggers
and generators to work ( a mis print in the interbase documentation)

 So I 'Insert' the Master record and it is given a generated ID. Now I
want to put that ID as the foreign key in a detail table. What is the
usual way of doing this? It must be a very common requirement.
I can generate the ID from the server to the client put it on the
Master record then  hold it and put it as required on detail records
as I insert them. (this is what I do in Paradox).
Or should I write a stored procedure, triggered by the transaction
commit, which generates all the required IDs and puts them on the
records at this time.
Or is there an automated way of doing this obvious requirement if the
fields are delared as 'foreign keys' in some way?