To start with, apologies for not posting in ages! I’ve had a few of you guys ask me where I went and to carry on. Life took over and I got too busy, but I’m going to try to revive the blog now.
So with that out of the way, back to the actual post….
For those who have worked on domain separated environment, you will know it often requires different approaches to the same requirements that you’d normally encounter on a non-domain separated environment.
One of the things that you always need to be careful about is integrations, in particular, mapping reference fields. With reference fields, you have the option to create new records on the fly, which I use often in general integrations.
The issue with domains however, is you’re probably doing an integration into a particular domain, but the create option on the transform map will create new records in the global domain – not great.
Also, when mapping to reference fields, you can map using names rather than sys_id. But what happens when you have two records with the same name, one in the global domain and one in your lower domain? You cannot guarantee which one will be selected.
Without a proper solution in place, you can end up with what I call domain cross contamination. For example, a CI in domain1, where the owner is a user in domain2 and the manufacturer a record from domain3. This is not a good situation to be in and rectifying it can be complex!
To get around this, I created the following script which searches a particular domain for the reference record, if it doesn’t exist, it searches the global domain, and then if it still can’t find it, it will create the record in the lower domain if required.