Perhaps a compromise architecture would be to write an extremely small and simple delete trigger after the trigger, which simply copies the deleted records to some new user object. This new custom object starts your workflow rule and thus sends the outgoing message you are looking for. The only problem with this is the periodic clearing of user object data, which will increase in size when deleting records from your other object. In other words, your “scratch” object simply needs to be cleaned periodically, which could be done on a night schedule with batch Apex.
Here's a deletion trigger that could do the trick using Opportunity as an example:
trigger AfterDelete on Opportunity (after delete) { List<CustObj__c> co = new List<CustObj__c>(); for(Opportunity o : Trigger.old) { CustObj__c c = new CustObj__c(); c.Name = o.Name; c.Amount__c = o.Amount; c.CloseDate__c = o.CloseDate; c.Description__c = o.Description;
This is not ideal, but at least it saves you from having to code your own outgoing messages based on triggers. This can only be done using the @Future annotation, by the way, since callouts directly from triggers are not allowed. Hope this helps.
source share