function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SH_OMSH_OM 

Launch a URL from Chatter action

Is it possible to launch a URL from a chatter action? So when I click a MyChatterAction it redirects the user to www.google.com for instance.
ShashForceShashForce
Hi,

You can create a global publisher action with "Action Type" as "Custom Visualforce", select a visualforce page which does the redirection to your URL.

Here is a simple VF redirection example using javascript. You can also use a custom controller for the redirection.

<apex:page >
    <script type="text/javascript">
        window.top.location = "http://www.google.com";
    </script>
</apex:page>

If this answers your question, please mark this as the Best Answer for this post, so that others can benefit from this post.

Thanks,
Shashank
satihillyersatihillyer
Thanks, and what if I wanted that google page to search a field from the record it was launched from, such as lead company? I thought it would be this:

<apex:page >
    <script type="text/javascript">
        window.top.location = "http://www.google.com/search?q={!Lead.Company}";
    </script>
</apex:page>

But I'm getting this error:

Error: Unknown property 'Lead.Company' referenced in MyChatterAction