Is it possible to embed javascript in Hyperlink formula field to open a vf page in a pop up?Can you share the formula,if possible?


Here is an example.

Use of formula field to open a visualforce page in Console and standard view page in Standard or Custom App. [applicable to Classic]

HYPERLINK("javascript:if(typeof(srcUp)=='function') {srcSelf('/apex/VisualforcePage?id=" & Id & "');} "+ 
" else {window.location.href='/" & Id & "'}" 
, "_Parent" 

You can refer my blog post: Different ways of navigation

  • Hi Santanu, I am trying to create formual field with the above code it is not letting me save by saving Incorrect argument value for function 'HYPERLINK()'. Javascript is not allowed. (Related field: Formula). Can you help me with my question? link Mar 4 '19 at 13:58

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.