Hi,
i have a problem with the onBeforeWrite hook.
I want to give a customer DataObject a special customer-number (Kundennummer in german) on the first write.
Here is the code:
function onBeforeWrite() {
/* new Customer -> generate Customer# */
if(!$this->ID) {
$this->Kundennummer = Kundennummer::createKundennummer($_POST["PLZ"]);
echo $this->Kundennummer; //56073001 <- correct
}
parent::onBeforeWrite();
}
But the result is, that the customer gets the default value (=0) as his customer-number.
Any ideas about this?
Greetings
Michael