Try OpenEdge Now
skip to main content
Programming Interfaces
Database Administration Entity Interface Reference : ITenant interface : ITenant examples : Adding domains to a tenant
 
Adding domains to a tenant
The following code shows how to use the Domains property to add a new domain to an existing tenant:
define variable tenant as ITenant no-undo.
define variable domain as IDomain no-undo.

tenant = service:GetTenant("ABC")
domain = service:NewDomain("ABCDomain").
domain:Description = "Domain for the ABC company").

tenant:Domains:Add(domain).

service:UpdateTenant(tenant).
A tenant must have at least one domain configured for it before a tenant user can access the data. The Tenant property on IDomain is updated automatically when it is added to Domains property collection of an ITenant. For more information, see IDomain interface.
Note: There must be at least one user in the tenant domain in order to login and access tenant data. This user must have an account in the authentication system configured for the domain. For more information on adding OpenEdge _User table users to a domain, see IDomain examples.