Update portal ID Field based on portal record not layout record
I have two tables: Entities & Ownership. They are related by Entities::EntitiyID. On a layout based on the Entities table I have a portal that links to the Ownership table. In that portal I set up a drop down list to select an Entity name to populate the Ownership::Entity field. This works fine but I also want to store the Entities::EntityID based on the selected portal record in the Ownership::OwnerID field in case the name field changes. Currently this field is populated by the Entity::EntityID of the selected record from the Entity table the layout is based on. How do I update it with the selected portal record from ownership?
I looked at PhilModJunk's example SimpleNameLookupDemo.fmp12 but could not figure out how to make it apply to this scenario.
Thanks in advance