I have created a custom button on a record that calls onClick JS to update the record. I would like to call the same JS button's function, from a VisualForce page. The purpose for this is so that I only need to maintain the button in one place (config). I would rather stay away from inline JS, or Apex.
I have tried the below, with little success...
<apex:commandbutton styleClass="btn-action" action="{!URLFOR($Action.Application__c.Approve,Application__c.id)}" value="Approve"/>
Do I need to use actionFunction?
Any thoughts would be appreciated!
This image should help. In the "standard" button row, there is an Approve button. In the blue banner below (a visualforce page), there is an Approve button, which needs to perform the same task (a field update on the record).