Current Session Domain - server side script

frankkuligowsk1
Giga Contributor

How do I get the currently selected Domain for a user session, for use in a Business Rule (or other server-side script)?

Using gs.getUser().getDomainID() will return the user's assigned Domain, not the one they've selected in the Domain picker.

I would like to be able to get the Domain that they have selected in the Domain picker.

1 ACCEPTED SOLUTION

thaddeusfreeman
Kilo Expert

var s = gs.getSession();


//id of current selected domain


var id = s.getCurrentDomainID();


View solution in original post

3 REPLIES 3

thaddeusfreeman
Kilo Expert

var s = gs.getSession();


//id of current selected domain


var id = s.getCurrentDomainID();


Thanks Thaddeus.


frankkuligowsk1
Giga Contributor

Sorry. False alarm.


I was checking the value via a Scheduled Job. That is not tied to a user session.


When I use gs.getUser().getDomainID() in a Business Rule, it does indeed show the currently selected session Domain.