diff --git a/src/Forms/FormField.php b/src/Forms/FormField.php index ecd9ede9a..e266325cb 100644 --- a/src/Forms/FormField.php +++ b/src/Forms/FormField.php @@ -475,8 +475,10 @@ class FormField extends RequestHandler $component = $record->relObject($relation); } - if ($fieldName) { + if ($fieldName && $component) { $component->setCastedField($fieldName, $this->dataValue()); + } else { + $record->setCastedField($this->name, $this->dataValue()); } }