[SalesForce] Add custom action to Action column on list view
Is it somehow possible to add custom action to Action column on list view?
Best Answer
The closest to what you're trying to achieve would be creating a new formula field on the Opportunity object, set it's return type to text, and in the formula expression enter the HYPERLINK function in order for the formula field to evaluate to html hyperlink () element. The first argument of the HYPERLINK function is the value of the href attribute. So you would want to set this either to some custom VF page which holds the processing logic you need in the custom action, or to a javascript function invoking some backend processing via JS remoting. The second argument of the HYPERLINK function is the text value of the link.
Once you're done with the above step, just add your new field to the List View.
Yes, you need to overwrite the entire related list with a Visualforce Page. It used to be able to be possible by injecting stylesheets and scripts and the like, but that has been disabled for some time.
Lightning Experience does support custom Visualforce-based buttons on list views. You could create a Visualforce page that receives the list of selected items (see here for more info https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_quick_start_massupdate.htm). You could give it a Lightning-like UI (using SLDS or lightningStylesheets="true") that asks for confirmation and then completes the action on the click of a button.
Best Answer
The closest to what you're trying to achieve would be creating a new formula field on the Opportunity object, set it's return type to text, and in the formula expression enter the HYPERLINK function in order for the formula field to evaluate to html hyperlink () element. The first argument of the HYPERLINK function is the value of the href attribute. So you would want to set this either to some custom VF page which holds the processing logic you need in the custom action, or to a javascript function invoking some backend processing via JS remoting. The second argument of the HYPERLINK function is the text value of the link.
Once you're done with the above step, just add your new field to the List View.