Is posible get the URL from a specifyc bean?
example in a hook:
public function helloWorld( &$bean, $event, $arguments)
{
echo $bean->getTheUrl();
exit;
}
I currently do this
echo $sugar_config['site_url']."/index.php?module=module_name&action=DetailView&record=".$bean->id;
exit;
pgr
2
So, does this code work well for you?
What exactly are you asking, if there is a function for this already in the core code? If so, I think the answer is no, not that I know ofâŚ
1 Like
Not works, this just is a question if exist something like that
[strike]$bean->getTheUrl();[/strike]
thanks!
pgr
4
I donât know of any function like that, I assume it does not exist.
I think that code you have in the âechoâ statement should work well, at least for most kinds of ânormalâ beans.
If you want to get the URL of the Page, this is something CORE php can do for you.
$_SERVER[âHTTP_HOSTâ] and $_SERVER[âREQUEST_URIâ];
ashish
6
a URL is a php thing,
just do it this way
https://www.php.net/manual/en/ref.url.php