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
Jim BoudreauxJim Boudreaux 

Standard Buttons in PageBlockButtons

I want all the standard buttons on a VF page, Edit, Delete, Clone as well as custom Buttons.
I figured out how to put the Edit and Delete buttons:
Code:
<apex:pageblockButtons >
           <apex:form >
               <apex:commandButton action="{!edit}" value="Edit" />
               <apex:commandButton action="{!delete}" value="Delete" />
           </apex:form>
</apex:pageblockButtons>

 
But I can't use this method to include the Clone button because there is no {!clone} method in my controller.
Furthermore, I don't know how to go about including any of my custom buttons.
 
Any ideas?
 
WesGrayWesGray
This is just a guess because I haven't tried this myself, but based on my reading I think what you would do to include a custom button would be to create a controller extension with a function to handle the code behind your custom button, then reference the custom button just like it was built in function.

As for the clone question, again just a guess, but can you use something like {!UrlFor($Action.Case.Clone)} to access the clone feature?  URLFOR works in VF pages.  Or maybe there is an apex clone command in which case you could create a custom function as described above.
jwetzlerjwetzler
There is no clone action, but all clone is is the edit action with a query parameter that sets clone=1.  I think you could probably use the Urlfor with $Action.Object.Edit and pass in clone=1 to get the URL
jwetzlerjwetzler
I have to correct myself, depending on the object you may or may not have access to the Clone action.  Give it a shot.
shruthishruthi

Even I have faced the similar issue. Absolutely wierd.
The view button of my object is over-ridden by a VF Page. It shows the edit and delete buttons.

Edit button is also over-ridden by a VF page. It shows the Save and cancel buttons.

When I use the edit button on my view page and then save it, I am not able to see the "EDIT" and "DELETE" buttons. My record's field values get changed as expected. When I click on the Object record again, I am able to see it.

I have compared the links and looks like its the same link except that the id has 18 digits in one and 15 digits in the other.

Does anybody have an answer or solution to this? 

 

Thanks