Salesforce: Replacing Custom Button with Formula Field

Ever wonder how you could use the formula field as an alternative to your custom button?

This can be achieved by utilising the HYPERLINK() and the IMAGE() functions as well as an image to represent the button. You could possibly settle with just a text link rather than button as well.

For example: HYPERLINK(${Construct_the_link_here},IMAGE(${the_path_to_the_button_image},”a_description_for_the_image”),${the_link_target_behavior-optional})

As a result, you could:

  • Define the field level security (considering it is a field) if you have specific requirement over who can or who can’t execute the button
  • Make the button appear in the view list and therefore,┬áthe user could use the button even without needing to drill all the way to the record

sample