How do I get the current domain in a client script

justinbayliss
Tera Expert

We have a domain separated instance. I need to get the domain within a client side script.
How can I get the domain name or the domain sys_id in a client side script. I don't want the one that the user's account is assigned to.

I want the one that is currently in use. So if the admin changes their domain it will have the CURRENTLY SELECTED domain.

1 ACCEPTED SOLUTION

Yep, gs is server side.



You could create a business rule to pass this information off to your client script using the scratchpad. But is this what you're looking for? Or do you actually need to know what the domain picker is set to?


View solution in original post

5 REPLIES 5

aaronanderson
Kilo Expert

Hi Justin,



Have you tried the following from your client script? This gets the domain of the user that's signed it but not necessarily the chosen domain from the picker. Is there a reason you need to know which specific domain was chosen?



var dom = gs.getUser().getDomainID();


Glide System(gs) is server side. So this wont work in the client script.


But yes, for giggles I did try it.


Yep, gs is server side.



You could create a business rule to pass this information off to your client script using the scratchpad. But is this what you're looking for? Or do you actually need to know what the domain picker is set to?


Perfect! I forgot about the g_scratchpad. This will help me do what I need. Thanks!!