- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-18-2016 07:13 AM
I work in a domain-separated environment with a large (~800) number of possible domains, many of them nested in successive layers, to support multiple-tenancy.
The challenge that I have is that, when needing to modify records from within a certain domain, the "domain picker" list is incredibly difficult to read and makes finding the correct domain a painful exercise. The field doesn't support any kind of "type ahead" feature and the order seems somewhat chaotic (not sorted A to Z for example).
I imagine this is a somewhat rare situation, but would anyone happen to know of an "easier" way to switch domains under circumstances like these?
Solved! Go to Solution.
- Labels:
-
User Interface (UI)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-19-2016 04:51 AM
It seems like my situation is a little unique and not something commonly encountered as an issue; that being said, I did come up with a little trick that gets the job done and figured I would share, just in case someone else finds it useful. This is a bit of a white-hat hack, but I figured out how to call the necessary actions with javascript. To use it, I just create a bookmark in the bookmark bar and call the following as the URL. It's a bit long, but it works in Geneva and Helsinki with UI16 (domain picker visible in the header). Matches on the last part of the domain name, which in my situation is unique, but could be modified to match the whole string easily enough.
javascript: var t = 'No Match';var tDomain = prompt('Enter the last part of the domain name:\rFor example, for Top/Acme, enter Acme\rCourtesy of Mike D. Jones');var domainD = document.getElementById('domain_picker_select');var dSplit;var dRange;for( i in domainD.options){if( domainD.options[i].text != undefined) {dSplit = domainD.options[i].text.toString().split('/');dRange = dSplit.length -1;if(dSplit[dRange].toString().toLowerCase() == tDomain.toLowerCase()) {t = domainD.options[i].value.toString().split('string:')[1];break;}}}if(t != 'No Match') {var scope = angular.element("#domain_picker_select").scope();scope.domains.currentValue = t;scope.updateDomain()}else{alert(t)}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-18-2016 12:15 PM
There is a handful of domain specific system properties. One like glide.domain.notify_record_change, that automatically changes the domain based on the record being viewed. Available System Properties - ServiceNow Wiki
You don't mention your SN version, but there is also a role domain_expand_scope, that gives you access to a UI action that allows you to blend your domain, and your current domain.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-18-2016 12:33 PM
Thank you for the reply. The version is Geneva.
Good point about domain_expand_scope, and that does help with modifying existing records. I realize I didn't include that some of our custom processes require that records be created under the specific domain using a data load process. There are some work-arounds, such as importing the records in a "top" domain and then changing the domain via the list-view, which is fine for small loads, but a pain for larger loads. There are a few other use-cases that call for starting in the correct domain, so the domain-picker continues to come into play, but excellent suggestions.
We've also considered loading specific users with the necessary roles / permissions to each domain and using Impersonate, but that adds a significant overhead vs. having a designated user with visibility across the domains.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-18-2016 01:29 PM
While I agree that the domain picker isn't very friendly, nobody but admins really uses it in my organization. I'm sure there's reasons for importing into a domain first, then changing to the correct domain, but seems like a lot of work that could be automated. Set the domain in the transform map maybe while the admin stays in TOP? Maybe a background scrip to change the domain would be faster?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-19-2016 04:51 AM
It seems like my situation is a little unique and not something commonly encountered as an issue; that being said, I did come up with a little trick that gets the job done and figured I would share, just in case someone else finds it useful. This is a bit of a white-hat hack, but I figured out how to call the necessary actions with javascript. To use it, I just create a bookmark in the bookmark bar and call the following as the URL. It's a bit long, but it works in Geneva and Helsinki with UI16 (domain picker visible in the header). Matches on the last part of the domain name, which in my situation is unique, but could be modified to match the whole string easily enough.
javascript: var t = 'No Match';var tDomain = prompt('Enter the last part of the domain name:\rFor example, for Top/Acme, enter Acme\rCourtesy of Mike D. Jones');var domainD = document.getElementById('domain_picker_select');var dSplit;var dRange;for( i in domainD.options){if( domainD.options[i].text != undefined) {dSplit = domainD.options[i].text.toString().split('/');dRange = dSplit.length -1;if(dSplit[dRange].toString().toLowerCase() == tDomain.toLowerCase()) {t = domainD.options[i].value.toString().split('string:')[1];break;}}}if(t != 'No Match') {var scope = angular.element("#domain_picker_select").scope();scope.domains.currentValue = t;scope.updateDomain()}else{alert(t)}