How to redirect to list view instead of details view after record edited or created
Tried after save hook with SugarApplication::redirect. getting error popup " there was an error while saving record" after clicking save.
Any solution to redirect the page to details view after save
Hi @hamaltonxavier,
to redirect to the list view after creating or editing a record in SuiteCRM 8, you could try to use the redirectToListView()
method. Here is an example of how to use it in an after_save
hook:
<?php
class CustomModuleHooks
{
function after_save($bean, $event, $arguments)
{
SugarApplication::redirect('index.php?action=index&module=YourModule');
}
}
Replace YourModule
with the name of your module.
Alternatively, you can use redirectToModule()
method to redirect to another module after save:
<?php
class CustomModuleHooks
{
function after_save($bean, $event, $arguments)
{
SugarApplication::redirectToModule('YourModule');
}
}
Again, replace YourModule
with the name of your module.