+ Start a Discussion
m pandeym pandey 

custom visual force page

how to get edit and delete button in a custom visual force page of account.....?
if click on edit it should edited and delete means it should deleted.....
Best Answer chosen by m pandey
vishnu Rvishnu R
hi....
<apex:column>
<apex:commandLink action="{!URLFOR($Action.Account.edit,a.id)}">
Edit
</apex:commandLink>
&nbsp; |  &nbsp;
 <apex:commandLink action="{!URLFOR($Action.Account.Delete,a.id)}">
 Del
 </apex:commandLink>
 &nbsp; | &nbsp;
 </apex:column>

just add this code in your vf page pageblock table...

hope this helps you...

All Answers

Amit GhadageAmit Ghadage
Hi pandey,
for deleting account use :
<apex:commandButton action="{!URLFOR($Action.Account.delete,AccountObject.Id)}" value="Delete" id="deleteButton" />

and to update use :
<apex:commandButton action="{!URLFOR($Action.Account.Edit,AccountObject.id)}" value="update" id="updateButton"/>

get AccountObject by get set or iterating List of Accounts as per your requirement

Best Regards,
Amit Ghadage.
vishnu Rvishnu R
hi....
<apex:column>
<apex:commandLink action="{!URLFOR($Action.Account.edit,a.id)}">
Edit
</apex:commandLink>
&nbsp; |  &nbsp;
 <apex:commandLink action="{!URLFOR($Action.Account.Delete,a.id)}">
 Del
 </apex:commandLink>
 &nbsp; | &nbsp;
 </apex:column>

just add this code in your vf page pageblock table...

hope this helps you...
This was selected as the best answer