Transform Map Script vs Domain Separation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-03-2015 05:19 AM
Good morning!
We've got some issues with domain separation while transforming data from import sets. In a business rule in the transform map (onBefore) I'm referencing as follows:
gs.getUser().getDomainId();
Unfortunately above code return domain ID from the logged user and it's not respecting chosen domain from the domain picker.
From the other hand, I've tested the same code in the Background Scripts module and it worked perfectly, even when I choose different domain from the picker, mentioned code returned proper value.
There's something wrong during transformation of import sets. Please advice.
Karol
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-03-2015 12:12 PM
Hello Karol,
Normally, in domain separation environment, when you want to load records (users, groups, ci items, locations etc), you associate them to the company
e.g, let us say that, ACME is the domain in which you have company A with sys_id of xyz32bit, your code should be like
target.company = 'xyz32bit'; // this will associate your record to the company A which indeed in domain ACME.
Here, target represents target table and 'company' is the company name field.
But if you are loading some configuration related things like choice list, then your code would be like
target.sys_domain = '32bitsysIDof ACME domain';
Hope this helps you loading the data you want to particular domain
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-03-2015 10:34 PM
Thank you for reply, but it's not helpful.
During import I'm checking if the company is defined in the current domain. Uploading person can change domain (using picker) just to operate in the desired area. Unfortunately, when using gs.getUser().getDomainId() it takes value from the user, omitting value selected on the date picker.
If you will test the same code in the Background Scripts module, you will see that it returns correct values (sys_id from the domain selected on the picker).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-04-2015 12:06 AM
Hi Karol,
I understand now your complete problem.
I think in your environment company is not configured for domain.
Normally we follow the practice to create at least single company per domain to associate records to that company which helps us during transformation. Also we create separate transform map per customer and select that transform map only while uploading data for customer. We write down target.company logic there per customer.
About your case, I will have to test it why it is not working.