We have a below hyperlink formula field. the intent is to display clones as a list in custom object and when we click on cloned id it should bring the detail page for the clones record.

HYPERLINK(Id ,"PA history View")

But When we click the id it shows webaddress with servlet in between.

so for example: instead of bringing https://salesforce.com/3292302442

it brings up https://salesforce.com/servlet/3292302442

how to get rid of keyword servlet?

BTW: WE are using sandbox for this and tried ie and chrome but both have same results.

Here is Page Block inside Visual force page:

<apex:pageBlock title="PA History">
  <apex:pageBlockTable value="{!Records}" var="Record"> 
        <apex:column > 
            <apex:facet name="header">PA#</apex:facet> 
            <apex:outputLink value="{!Record.PALink__c}">{!Record.id}</apex:outputLink>
        <apex:column >
          <apex:outputLink value="{!Record.id}">{!Record.id}</apex:outputLink>

        <apex:column > 
            <apex:facet name="header">PA Trigger</apex:facet> 
            <apex:outputText value="{!Record.Trigger_Events__c}"/> 
        <apex:column > 
            <apex:facet name="header">Revision #</apex:facet> 
            <apex:outputText value="{!Record.PA_Rev_No__c}"/> 


You are missing a forward slash. Try:

HYPERLINK("/" & Id, "PA history View")

This will output HTML similar to what is below, with a relative URL to the object you want.

<a href="/a0Kd000000GBStn" target="_blank">PA history View</a>

Bare in mind that this formula field is now a hyperlink (i.e. the output is what is shown above), it is not just a URl. If you are using this field in a visualforce page then you don't need to use a apex:outputLink tag as it is already a hyperlink. You could display it using an apex:outputText but with escape set to false so that it displays correctly.

<apex:outputText value="{!Record.PALink__c}" escape="false"/>

Or if you wanted to not use a formula field at all you could do it all in the VF page:

<apex:outputLink value="/{!Record.Id}">PA history View</apex:outputLink> 
| improve this answer | |
  • I tried it before but the same thing, even we tried adding id as <apex:outputLink> but servlet keyword is keep coming. This is what we tried in visual force page: <apex:outputLink value="{!Record.id}">{!Record.id}</apex:outputLink> – Noor Feb 19 '15 at 14:56
  • Is this formula being used directly in VisualForce or is it being used in a formula field? – BarCotter Feb 19 '15 at 15:18
  • BarCotter this formula is being used in formula field. – Noor Feb 19 '15 at 15:21
  • What type of formula field? Is it a Text formula? – BarCotter Feb 19 '15 at 15:25
  • yes it is a text formula field. – Noor Feb 19 '15 at 15:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.