I'm very new in Salesforce, basically I'm from Java background and from last 15 days I've started learning Salesforce.

Question: I have a custom object "AdditonalRevenue__c", and when any user will delete record from this object with "Amount__c" value great than 50 then I want to capture reason for delete and send the reason in an email to a queue.

Process I'm following: - Override the custom delete button action with a visual force page. So, if someone will click delete then it will come to the visual force. If Amount__c greater than 50 it will display a reason text area else it will show a confirm message with confirm and cancel option.

Problem:- How I'll capture the reason without creating any custom field in any object?

If we can implement the same requirement in some other way then I'll be very happy to know that also.

  • Hi SFDC-Learning, welcome to SFSE! Please take the time to visit the Help center and read How do I ask a good question. The more details you provide, including code and/or workflow/validation rules you've written, the more likely it is that someone will respond to your question with an answer you'll find helpful.
    – crmprogdev
    Sep 8, 2015 at 18:19

1 Answer 1

  • Create a custom field on that custom object to store the reason text.
  • Write a trigger on the custom object on "before delete" event.
  • In trigger write condition by which you can identify deletion reason (amount >50)
  • Update the field with that reason.
  • Send an email to person with the deletion reason form the trigger.

This way, whenever the record will be deleted it will have its deletion reason. So, if you undelete it you can know why it was deleted.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .