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
murielmuriel 

Output link not behaving the same depending on the environment

This is a bit odd but i am sure there is a logical explanation....i just dont know which one...so please help if you can

basically:

in my own developer env, this code

<apex:outputLink value="{!rel.Id}" target="_blank">{!rel.casenumber}</apex:outputLink>

will produce the following URL "https://eu2.salesforce.com/500b0000005dAtVAAU".  Obviously the Id might change depending on the record selected


However in the full sandbox, the same code produces:

 https://c.cs8.visual.force.com/apex/500D000000ZF8b0IAD


it is keeping the "apex".  and the URL fails


I just need to understand why it is doing that. I could change it to a fix URL but i would like to understand why first before moving it to production


Thanks

Muriel
kiranmutturukiranmutturu
when you are calling this link from a vf page it will come like that as salesforce will render vf pages from differenct domain...so you should construct the url in th e code using system.url class...
murielmuriel
Thanks kiran.

I had another look between both visual pages , only to realise that the one working was with a "/"

<apex:outputLink value="/{!rel.Id}" target="_blank">{!rel.casenumber}</apex:outputLink><p/>

tried it on the full sandbox and it seems to be fixing the issue (not sure why...)

so will keep it like that for now