0

I have a formula field on custom object called "RE_Opps with AccountID". This formula field is a link to one of the reports. The formula goes like this

IF(
  Regional_Account_Assigned__c,
    HYPERLINK("/00O130000090Ae6","Opportunity Report"),
  HYPERLINK("/00O130000090AdD?pv0="&Customer_Account__c,"Opportunity Report")
)

I have created an email template which holds the details on the custom object except "RE_Opps with AccountID". I want this field to be shown in email like an output link. Can someone tell me how to do it.

<br/>
RE_Opps with AccountID: <i> 
      <apex:outputlink 
              value="{!LEFT($Api.Partner_Server_URL_140,
                       FIND('.com',$Api.Partner_Server_URL_140)+4) +
                       relatedTo.RE_Opps_with_AccountID__c}"> 
                             {!relatedTo.RE_Opps_with_AccountID__c}
      </apex:outputlink>  </i>

I tried it this way but it doesn't work. Any help is appreciated.

2

You will need an intermediate formula field that is the /reportId?params

Report_URL__c = IF (Regional_Account_Assigned__c,
                    "/00O130000090Ae6",
                    "/00O130000090AdD?pv0=" & Customer_Account__c
                    )

and change your hyperlink formula field to:

HYPERLINK(Report_URL__c,"Opportunity Report")

then, your Email template can use:

<br/>
RE_Opps with AccountID: <i> 
  <apex:outputlink 
          value="{!LEFT($Api.Partner_Server_URL_370,
                   FIND('.com',$Api.Partner_Server_URL_370)+4) +
                   relatedTo.Report_URL__c}"> 
                        Opportunity Report
  </apex:outputlink>  </i>

This all presumes the recipient is a Salesforce user. Non-users can't view SFDC reports

  • @Harvey My pleasure, as a service to the Community, once you're happy with the answer, mark it as the answer. – cropredy Sep 2 '16 at 17:55

Your Answer

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