NetTalk Central

Author Topic: Secwin7 multitenant How to get the Tenant name ?  (Read 2872 times)

seanh

  • Jr. Member
  • **
  • Posts: 94
    • View Profile
    • Email
Secwin7 multitenant How to get the Tenant name ?
« on: January 08, 2023, 10:52:51 PM »
When a session is started I set a couple of session values for later:
            self.SetSessionValue('CurrentTenant_id',SecwinCurrentUser.GetSettingsGuid())
            self.SetSessionValue('CurrentUser_id',SecwinCurrentUser.GetGuid())
These are set in the WebHandler in  p_web.SetSessionLoggedIn

Question now is :  Whats the best way to get the Tenant Name ?   ie the Settings Company Name?

I know I can Fetch the record directly but it seems to me there should be an existant method available at this point, because it's the sort of thing you would want,  but I can't find it.

?

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Secwin7 multitenant How to get the Tenant name ?
« Reply #1 on: January 09, 2023, 11:03:23 PM »
for build 7.42 I've added a
SecwinCurrentUser.GetCompany()
method.

This returns the "company" field from the SecwinSettings Table.

seanh

  • Jr. Member
  • **
  • Posts: 94
    • View Profile
    • Email
Re: Secwin7 multitenant How to get the Tenant name ?
« Reply #2 on: January 10, 2023, 12:11:11 AM »
Brilliant !

Thanks Bruce