Set a variable with the PRIMARY KEY (from companies) before you go to the new layout. Then set the FOREIGN KEY (in contactperson) with that variable, just after the record is created and before going back to the original layout.
1. Set Variable ( $companyID ; Companies::ID )
2. Go to Layout ...
3. New Record/Request
4. Set Field ( Contactperson::FIDCompanies ; $companyID )
Thanks Beverly! Solved!
An alternative is to allow creation (in the relationship), then in your portal you'll see a blank line at the bottom. If you type into this line, the key is automatically set for you.