function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ManishaPManishaP 

Add custom Button on visualforce page

I have a javascript button on a custom object and want to call it from visualforcepage. It works on standard page layout but on visualforce page gives, URL does not exist error.
<apex:commandButton value="Validate" action="{!URLFOR($Action.Custom_Object__c.Custom_Button_Name, Custom_Object__c.Id, null, true)}" id="validateButton" rerender="pgBlock"/> 
Any help is greatly appreciated
salesforce mesalesforce me
Hi Manisha which custom object u can write the visualforce program. custom object name&custom buttun name...

u can paste your custom buttun name&custom object name here...
<apex:page >
<apex:form>
<apex:commandButton value="Validate" action="{!URLFOR($Action.Custom_Object__c.Custom_Button_Name, Custom_Object__c.Id, null, true)}" id="validateButton" rerender="pgBlock"/>
</apex:form> 
</apex:page>

 
ManishaPManishaP
i used the same code but its giving following error---

URL No Longer Exists
You have attempted to reach a URL that no longer exists on salesforce.com. 

You may have reached this page after clicking on a direct link into the application. This direct link might be: 
• A bookmark to a particular page, such as a report or view 
• A link to a particular page in the Custom Links section of your Home Tab, or a Custom Link 
• A link to a particular page in your email templates 

If you reached this page through a bookmark, you are probably trying to access something that has moved. Please update your bookmark. 

If you reached this page through any of the other direct links listed above, please notify your administrator to update the link. 

If you reached this page through a link on our site, please report the broken link directly to our Support Team and we will fix it promptly. Please indicate the page you were on when you clicked the link as well as any other related information. We apologize for the inconvenience. 

Thank you again for your patience and assistance. And thanks for using salesforce.com!

Click here to return to the previous page.