0

I've discovered that outbound messages won't ever get triggered on a records deletion within SalesForce. This presents a problem for the external database we have that receives the outbound messages becoming instantly out of date, so I need to resolve somehow.

I understand that I can code a solution with the GetDeleted function but is there a simpler way to set this up without coding ? All I would need to do in theory is setup a similar soap type message that is pushed to out external system with the unique object id of the related record/s and it would then handle finding and deleting the content.

2
  • WFR and PB can't fire on delete. I think you will need code.
    – Adrian Larson
    Commented Jun 24, 2016 at 23:06
  • Ok... You haven't seen any clear examples of such code online have you? @AdrianLarson
    – AdamJones
    Commented Jun 25, 2016 at 7:34

1 Answer 1

0

With some caveats, you could pull this off declaratively by using a flow (visual workflow) to delete the record.

The flow would create a record in a custom object and would pass the ID of the record being deleted (along w/ any other fields, if needed). The outbound message would be triggered off the custom object via a workflow rule, and an auto-launched flow on the custom object would delete the 'parent' record.

Some things to consider:

You should remove delete permissions from users, as else users could delete from list views, even if you removed the delete button from the page layout.

Alternatively, you may be able to embed the flow in a visualforce page and override the delete button to point to the flow - not sure if that would work though, have not tried it.

I think it would be best if the user-initiated flow checks a custom field on the record to be deleted, as this will respect FLS / CRED / Sharing. Then an auto-launched flow (which runs in system mode) can handle the creation of the custom object record and the deletion of the 'parent' record. So users would not need any CRED on the custom object record.

All in all, it might be easier to pull in a developer to code it up - but this should work.

You must log in to answer this question.

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