- Create a custom button of type url by selecting button and links options on custom and standard object .
- Now in you visulaforce page you can directly use your cusotm button by using URLFor Attribute here is the syntax.
<apex:page standardController="Contact" >
<apex:pageBlock >
<apex:sectionHeader title="URLFor Example" />
<apex:form >
<apex:commandButton action="{!URLFOR($Action.Contact.TestButton,RecordId)}" value="URLFor Example"/>
</apex:form>
</apex:pageBlock>
</apex:page>
We create a action button on contact object with name TestButton . now by using urlfor you can use it directly in your visualforce page . you can also pass recordid if needed in second attribute.
NOTE : We Cannot call lightining action by using URLFOR
Hits: 283