diff --git a/src/ORM/DataObject.php b/src/ORM/DataObject.php index a576d96b685..86ddce77032 100644 --- a/src/ORM/DataObject.php +++ b/src/ORM/DataObject.php @@ -2507,7 +2507,7 @@ public function scaffoldFormFieldForHasOne( $list = DataList::create(static::class); $threshold = DBForeignKey::config()->get('dropdown_field_threshold'); $overThreshold = $list->count() > $threshold; - $field = SearchableDropdownField::create($fieldName, $fieldTitle, $list, $labelField) + $field = SearchableDropdownField::create($fieldName, $fieldTitle, $list, $ownerRecord->{$relationName . 'ID'}, $labelField) ->setIsLazyLoaded($overThreshold) ->setLazyLoadLimit($threshold); return $field;