Using Typo3 V11.5.15 I need a way to move from a form, where you add a new employee to a list, to another form when the given company doesn't exist yet.
I tried using redirect and the URI builder but nothing seems to work.
I do explicitly NOT want to have a f:link.action in a second page where the user can check the input. I often see this recommended in older threads.
Edit1 I did check into the 4 year old work around for the old bug with redirect using AJAX. But this should be obsolete by now and the older solutions seem to not work.
Edit2
I did something similar to Stefan Bürk's answer suggests.
//added the UriBuilder first
use TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder;
//new instance of UriBuilder and using it to ... build the Uri....
$uriBuilder = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(UriBuilder::class);
$uriBuilder->setTargetPageUid($PageUidGoesHere);
$uri = $uriBuilder->uriFor($ControllerAction, $ParametersArray, $ControllerName, $ExtensionName, $PluginName);
//redirecting to selfmade Uri
return $this->redirectToUri($uri);