Calling the TenantSwitch System action changes the context of the application from the current tenant to the specified tenant. When using the TenantSwitch System action, the session is cleared, the OnSessionStart action of the specified tenant is executed, and the transaction in the current tenant is committed. Learn more about Handling Transactions.
This action can be used when creating a tenant provisioning application. When the end-user fills in the necessary information, a new tenant is created, and the TenantSwitch action is used to change the context of the application, making the end-user constrained to the newly created tenant. Learn more about using the TenantSwitch in the How to Build a Multi-tenant Application Technical Note.
Notice that the new tenant must have the same User Provider of the previous tenant.
TenantId: tenant identifier, available in the TenantId site property.
Entity Reference Type. Mandatory.
Overview of System Actions and Functions | Using Web Services in Multi-Tenant Applications