+ Start a Discussion
RimaRima 

Delete functionality not working

Hi All,

 

I have a visualforce page that has delete command button. My code as follows.

 

<apex:commandButton action="{!delete}" value="Delete"/>

 

When I click on delete button on the page, it is not deleting the record. Could anyone please let me know how can I make delete button work? Your help is greatly appreciated.

 

 

Best Answer chosen by Admin (Salesforce Developers) 
mikefmikef

This worked for me. Your issue might be permissions based.

 

 

<apex:page standardController="Contact">
<apex:pageMessages />
<apex:form >
<apex:commandButton action="{!delete}" value="delete" />
</apex:form>
</apex:page>

 

 

All Answers

mikefmikef

This worked for me. Your issue might be permissions based.

 

 

<apex:page standardController="Contact">
<apex:pageMessages />
<apex:form >
<apex:commandButton action="{!delete}" value="delete" />
</apex:form>
</apex:page>

 

 

This was selected as the best answer
RimaRima

Hi,

 

Thank you for your response and I appreciate your help. Now the "delete" is working. It did not work earlier because I was overriding "delete" page with some Visualforce page. I changed it to Standard  Salesforce.com page and now it is working.