How to embed a URL that links to VF page that works for both Partner and Internal Users?

  • 1
  • Question
  • Updated 3 years ago
  • (Edited)
We recently implemented a Partner Portal, but are having trouble embedding links in our templates to VF pages that work for both our internal users and our partner users.   

What we are trying to do:

1.  Link to a VF page called "OpportunityTable"

2.  Be able to embed this link in a template that prepends the proper address whether the logged in user is a Partner or Internal user.  


Here is what I've tried:

ATTEMPT #1
<a href="/apex/c__OpportunityTable"> 
Which generates the following URL:
https://buildrealty.force.com/apex/c__OpportunityTable

Results:

Partner User - "Under Construction" message is displayed
Internal User - Works Correctly



ATTEMPT #2
<a href="/partners/apex/c__OpportunityTable">
Which generates the following URL:
https://buildrealty.force.com/partners/apex/c__OpportunityTable

Results:

Partner User - Works Correctly
Internal User - "URL No Longer Exists" message is displayed
Photo of Gary Bailey

Gary Bailey

  • 1,628 Points 1k badge 2x thumb
  • This problem feels familiar

Posted 3 years ago

  • 1
Photo of Gary Bailey

Gary Bailey

  • 1,628 Points 1k badge 2x thumb
Almost solved....but not quite out of the woods yet.  


ATTEMPT #3 (success but with unintended results)
<a href="partners/apex/c__OpportunityTable">
Which generates the following URL:

https://buildrealty--c.na20.visual.force.com/apex/partners/apex/partners/apex/partners/apex/c__OpportunityTable

Results:

Partner User - Works Correctly (kinda)*
Interal User - Works Correctly (kinda)*


The problem now is that the above template creates a longer and longer URL each time I click on it.  Each time I click on the link it adds another "/apex/partners" into the middle of the URL.  It keeps getting longer and longer........

Now I'm more confused than I was when I started!
(Edited)
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Two ideas. 

1. If you are willing to override the Tab Action - you can simply pass the url:   <a href="/003/o">  which will kick off the redirects you set up in Page Assignments and take the user to the correct place. 

2. You could also explore the {{$Site}} global merge varialbe within your URL.  I know this will prepend the correct community name,  I'm just not sure what it will do in the Internal User context.  Look for more information here: http://help.skuidify.com/m/11720/l/187263-global-merge-variables-functions

Good Luck.