Pergunta

I have an existing Workflow Rule that fires of a (SOAP) Outbound Message when a certain type of object is created or updated. That works fine.

I want to extend it so that a similar Outbound Message is also sent when the objects are deleted.

According to this discussion, Workflow Rules cannot be made to fire based on object deletions, so I have to write an Apex Trigger instead.

So the question is, how do I kick off a SOAP Outbound Message from within Apex?

Foi útil?

Solução

It should be quite simple - as long as SF supports your web services SOAP version. Import the WSDL for the service (you can do this from the 'Apex Classes' page) and add an appropriate trigger type that calls the WSDL defined method(s).

Outras dicas

I'm new here so I can't add a comment to weesilmania's post, but I wanted to point out something important. The outbound messaging feature in salesforce is pretty fault tolerant and reliable. Meaning if your endpoint goes down for a while, or if the network connection between salesforce and your server is flaky, salesforce will retry sending a triggered outbound message for up to 24 hours.

Implementing an apex callout that happens on a trigger will work, but it's fire and forget. Keep that in mind if using this option.

Real "Outbound Message" (created as an entity somewhere in application Setup, with merge fields etc.) - no idea.

Your own HTTP request where you define your own endpoint as well as payload that might be a valid SOAP envelope - have a look here and here for a start.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top