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
umeninnovationumeninnovation 

How to send an outbound message on delete

I'm using outbound messages to insert/update contact records on a local database. But I would also like to delete (or deactivate) these records when they are deleted through the salesforce web interface. Is it possible?

 

I see there's a IsDeleted field in Contacts, but the delete action doesn't trigger the workflow that sends an outbound message.

Best Answer chosen by Admin (Salesforce Developers) 
WolffsenWolffsen

Found the solution. It is simply not possible. You have to use the GetDeleted method in order to get the deleted and run this on certain intervals (depending on how often makes sense for your app. Mine will have to query every 10-30 min).

 

http://community.salesforce.com/sforce/board/message?board.id=general_development&message.id=21881&query.id=108508#M21881

All Answers

WolffsenWolffsen
If any one knows the answer to this one, I am also looking for a way to receive a message everytime a contact or lead is deleted.
WolffsenWolffsen

Found the solution. It is simply not possible. You have to use the GetDeleted method in order to get the deleted and run this on certain intervals (depending on how often makes sense for your app. Mine will have to query every 10-30 min).

 

http://community.salesforce.com/sforce/board/message?board.id=general_development&message.id=21881&query.id=108508#M21881

This was selected as the best answer
JaromirvangorselJaromirvangorsel

I normally create a [Objectname]_deleted Object and write a record to it by catching the before delete event on the deleted record Object. Then I create a Workflow with outboundmessage on that _deleted object.

 

Not the most beautiful solution but it works fine.

 

Good luck all.

mitumitu

can u send the code its helpful for me

don.mcintosh1.3945838050317573E12don.mcintosh1.3945838050317573E12
@Jaromirvangorsel that seems like a good solution to me but why do you put that in the before trigger? Might be better in an after trigger, once you are sure that the delete has not failed.