diff --git a/www/lib/class.erpapi.php b/www/lib/class.erpapi.php index 77825e1b..e4b2f536 100644 --- a/www/lib/class.erpapi.php +++ b/www/lib/class.erpapi.php @@ -26081,7 +26081,14 @@ function MailSendFinal($from,$from_name,$to,$to_name,$betreff,$text,$files="",$p } } else { - $this->app->DB->Update("UPDATE firmendaten SET " . $field . "='$value' WHERE id='" . $firmendatenid . "'"); + + $column_exists = $this->app->DB->Select("SHOW COLUMNS FROM firmendaten WHERE field = '".$field."'"); + + if ($column_exists) { + $this->app->DB->Update("UPDATE firmendaten SET " . $field . "='$value' WHERE id='" . $firmendatenid . "'"); + } else { + $this->AddNeuenFirmendatenWert($field, $typ, $typ1, $typ2, $value, $default_value, $default_null, $darf_null); + } } $db = $this->app->Conf->WFdbname; if(!empty($this->firmendaten[$db])) {