Default value for add field

Hi ,I am building cruds,buildings and apartaments ,building crud is done ,i created a custom action to get to the apartmanets crud ,I use where for just show the apartments of passed building id ,but i need when inserting a new apartmanet ,the building id can be set by default and elimínate the select in the add Form ,any sugestion please ,thanks