Form is not updated after saveRelationshipsUsingCallback

I am creating a new form field, which is based on a relationship. In the saveRelationshipsUsing, I am setting the new values with the ->state() method. I tested it one line later with dd and I can see the correct values. The problem is, that the form field doesn't get the new values. It keeps the old ones. After a page refresh I can see the new ones (so the save process is working). I tried to debug it, by adding a dd into the afterStateHydratedcallback (not on page load, just before I click on save). There I still have the old values as well.
3 Replies
Dan Harrin
Dan Harrin15mo ago
send the code
bernhard
bernhard15mo ago
I solved it in the meantime by reloading the relationship
$this->getRecord()->load($this->name)
$this->getRecord()->load($this->name)
Dan Harrin
Dan Harrin15mo ago
ok, but we cant help unless we see the code