Hello guys!

Scenario: I am sure all of you come across this everyday if you do integrations. I have 2 sets of machines (Training and Production). The outbound messages in prod. instance point towards production machine & for training sandbox to the training machine.

Question: On Refresh, the Endpoint URL changes to the Endpint URL in prod. That is fine! But is there a way to control it? How can I dynamically reference this EndPoint URL from somewhere else?

To be specific:

EndPoint URL: {!TrainingMachine}/Outbound/SOAPMessage/Account

This EndPoint URL is just an example. Here 'TrainingMachine' is some sort of a merge field or some sort of component. I know this does not exist as a standard functionality in Salesforce at the moment but has some one achieved this via a hack?

Thank you guys for the help.


1 Answer 1


You might want to look at Post Sandbox Refresh Steps. I'm not saying it's the right way to disable/reconfigure them manually but that's what it seems to happen widely in the community ;)

I don't think you can do much with Outbound Messages.

In the past I've benefited from having some kind of proxy between Salesforce and my target system so I've been passing Organisation Id in the URL and the proxy decided where the message should arrive at. This works nicely if it's an Apex callout (SOAP/REST). If you can't put any merge fields in the endpoint... maybe a header sniffing? IP addresses check?

Another option (again - more for integration kicked off from Apex): you could experiment with custom settings (they don't get copied to Dev Sandboxes but they are copied to full sandboxes though). Or URL class will let you learn whether you're on "eu1.salesforce.com" or not ;)

Ok, the "sane" stuff is out of the way, time for crazy ideas.

Duplicate all your workflows that fire the Outbound Messages. In the condition formula play with {$Organization} or {$Api} fields ;) Keep other conditions intact (depending how many OMs you have, you might decide it's safer from maintenance point of view to move common parts to a hidden formula field). And just call one or another ;)

  • Org Id might change on the refresh so using Org ID does not scale. @eyescream - I was thinking of the same - but then for different scenario you will have to write different Outbound messages. So, for training I will write one, Production - there will be one, any other sandbox, there will be one, and the list will just go on. And i think there is a limit on the number of outbound messages you can have in the org too. So, this would not work in this particular case.
    – subodhbahl
    Feb 1, 2013 at 22:54
  • The thing is I could use Custom settings/URL class/Org Division but how do I reference these things in the 'Endpoint' URL field? This field does not support merge fields according to my experience. So, these workarounds fail.
    – subodhbahl
    Feb 1, 2013 at 22:56
  • Currently we do header sniffing and I think its not an optimal solution going forward. This is why I wanted to ask if this could be possible in SF. But I appreciate your help :)
    – subodhbahl
    Feb 1, 2013 at 22:57
  • 1
    Production ID will stay the same (except some amazing situation when you ask SF support to migrate whole org). I needed only prod vs test so it wasn't that bad... Consider rewriting them to trigger + @future + callout where you have full control :/ Or check if you can send in the payload a formula field that will contain $Organization-based "delivery address". I'm out of ideas, didn't have to do much with OM; it was always either consume other system's WSDL or let them pool for updates so SF wasn't the actor initiating the flow.
    – eyescream
    Feb 2, 2013 at 1:10
  • Prod vs test via organization does not seem like a bad idea. Although, we have configured our other system to flag all the OMs from anywhere except the prod. SF so all the retries are cancelled. Thanks for the help!
    – subodhbahl
    Feb 4, 2013 at 16:06

You must log in to answer this question.

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