Ask Search:
Ofri HeffetzOfri Heffetz 

Hyperlink in formula field

Hi, 
I'm Trying to create a formula field with hyper link to a custom report.
I'm trying to populate some field's values in order to place them in the report filters. 
It worked as a custom link but when I put the same link in a formula field it doesn't seems to populate the values .
This is the link I've created : 

HYPERLINK("/00OZ0000000UvyD?pv0=Account_ID__c&pv1=QuoteLineItem.Product_Name__c", "Latest Price")

What do I need to change in order to see the values and not the actual field names in the report filters? 

Thanks!
 Ofri 
Best Answer chosen by Moderator (salesforce.com) 
Pierre Despatis-DupontPierre Despatis-Dupont
Try this:

HYPERLINK("/00OZ0000000UvyD?pv0="
& Account_ID__c
&"&pv1="
& QuoteLineItem.Product_Name__c
,"Latest Price")

It works in my org when I change the field names. If you still get errors, try the "check syntax" button and let us know what the error is.

All Answers

Pierre Despatis-DupontPierre Despatis-Dupont
It is because all the fields are in quotes in your formula. Salesforce will just consider it as text. If you have a formla that is ="1+1", because of the quotes salesforce will display 1+1 and will not calculate the formula. 

Use "&" to add fields or text (in quotes) in the link. 

HYPERLINK("http://salesforce.com"
&Field_Name__c
&"some more hard coded text"
&Field_Name2__c
,"Salesforce")
Ofri HeffetzOfri Heffetz
Can't get it to work...
Pierre Despatis-DupontPierre Despatis-Dupont
Try this:

HYPERLINK("/00OZ0000000UvyD?pv0="
& Account_ID__c
&"&pv1="
& QuoteLineItem.Product_Name__c
,"Latest Price")

It works in my org when I change the field names. If you still get errors, try the "check syntax" button and let us know what the error is.
This was selected as the best answer
Ofri HeffetzOfri Heffetz
Thank you! it's working !!