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
Brian12345Brian12345 

Outputlink redirects to www.salesforce.com for my customer portal users. Can I change this?

We send our customer portal users a VF email template that contains links to documents and detail pages in the Customer Portal.  If a user is not already logged into the portal (which, 95% of the time, they are not), when they click the link they will be directed to www.salesforce.com to logging.  This will confuse our users....as they need to logging from our website.

 

So how can I change the default behavior of the outputlink to redirect the portal user to our homepage rather than www.salesforce.com?

 

Thanks!

 

 

 

 

Always ThinkinAlways Thinkin

Hi Brian,

I've been wrestling with a good way to do this for years, the best that I've come up with is hardcoding the portal parameters and inlcuding a start URL. The downside is that if they are in the portal already, I think it will take them back to the login page.

 

Using a standard URL in an <a> tag or <apex:outputlink>:

https//login.salesforce.com/secur/login_portal.jsp?orgId=00D800000XhXhXhXh&portalId=06080000000UJuJUJ&startURL=/{!RelatedTo.Id}

 

 

or get fancy and use parameters:

<apex:outputlink value="https://login.salesforce.com/secur/login_portal.jsp">Output Link Test
<apex:param name="orgId" value="00D800000XhXhXhXh"/>
<apex:param name="portalId" value="06080000000UJuJUJ"/>
<apex:param name="startURL" value="/{!RelatedTo.Id}"/>
</apex:outputLink><p/>

 

Note that using login instead of your instance number ensures redirection should your instance change. 

 

trmptrmp

Hi, Luke!

 

I realize this post is really old, but I was wondering if you had any recent revalations on this? I'm looking for a link that can route a portal user to a record if they are logged in and to send them to the appropriate portal login page if they are not. Forcing them to always log in is a pain and giving them an "already logged in" link could cause problems if they actually are not logged in. >.<

 

This was the only relevant post I could find with my current Google-fu.

 

Thanks!