Redirect with SugarApplication:redirect()

Hello,

I saw here on the forum how to use SugarApplication:redirect() in php code for redirection, but when trying to use it I was unsuccessful. I tried in a few ways:

SugarApplication::redirect("#Leads");
SugarApplication::redirect('index.php?module=Leads');
SugarApplication::redirect("URL");
I added this in my code below save():
if ($bean->moment_c == "Nao Cliente" && $bean->parent_type == "Leads")
        {
            $beanLead->no_client_c = 1;
            $beanLead->moment_c = $bean->moment_c;
            $beanLead->reason_no_client_c = $bean->reason_no_client_c;
            $beanLead->save();
            SugarApplication::redirect("#Leads");
        }
Could you please help me? Do I need to add anything else in the code besides the SugarApplication:redirect()? How can I redirect to list view through php?
Parents Reply
  • Hi André

    It's a custom logic hook, I'm trying to redirect after filling in the fields. I tried to redirect with js, the redirect happens, however, it doesn't do the whole process that the logic hook should do, it seems that it breaks the execution of the logic hook.

    Regards,

    Maria Mattos.

Children