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 !! 
ramana kumarramana kumar
Hi Pierre,

Can we Make this Formula text ( HYPERLINK(...) ) field as Required field.
Rachel LarsenRachel Larsen
Hi Pierre, 

I am hoping you can help me out. I am trying to link an opportunity stage field to a contact stage field. I have created this formula, however the syntax says I am missing something. I try to add what it says I am missing, however it keeps saying it is wrong. Any ideas? 

Here is what I have: 

HYPERLINK("https://na8.salesforce.com/006/e?retURL=%2F003C000001wZ3Gn&accid=001C000001NdqKs&conid=003C000001wZ3Gn"("&Id&opp11="))

Is this something you can help me with?
Rachel LarsenRachel Larsen
I should also mention that the opportunity field is a picklist and I just want it to autopopulate into the contact record. Here is another formula I have tried:

Opportunity_Stage__r.StageNameINCLUDES(Inquiry, Intake, Assessment, Won-Assessment, Lost-Assessment, Close, Dischargd, Active)

Thanks,

Rachel