mutateFormDataBeforeCreate question
I want to send an API request before I store data in my DB so I use mutateFormDataBeforeCreate in my relevant Create Record page.
Is it the most suitable way to interrupt the saving process ?
I noticed that
When I try to get the data I cannot see the multi select data that are in a many to many relationship. Do you know why?
Thanks!
5 Replies
Try
$this->form->getRawState()
without validation and $this->form->getState()
with validation.It worked with
$this->form->getRawState()
. Thanks!Just be cautious. That data hasn’t been validated.
Is this a good way to interrupt the creating process to send the API call to an external service?
As good as any I guess.
There’s nothing inherently wrong with it.