201
Views
5
Comments
Solved
Multitenancy support for reactive web apps
Question
Application Type
Reactive

Wanted to know if reactive web apps doesn't support multi-tenancy on its own. I understand that Site.TenantId is available only on server side and I've put all the aggregates that fetch data on server actions. But still, I get all the data listed irrespective of the user's tenant. Do we need to filter the data manually based on tenant id in reactive?


2021-06-02 20-50-04
Márcio Carvalho
Solution

https://www.outsystems.com/forums/discussion/46284/multitenancy/

Check this. I don't have experience in multitenant, but this answer maybe answer your "problem", in case you have changed the table setting to display the tenant ID.

"Since you choose to expose the TenantID of entities, by checking the "Show Tenant Identifier" you lose the automatic parts of the Outsystems that insert that value on creating and filter on aggregates. Only in rare cases you check this option. In your case or you uncheck this and you let Outsystems handle TenantId for you or if you really want to have this checked you need to handle it yourself. "


2021-03-05 13-56-11
Ricardo Pereira
 
MVP

hi,

This topic already was discussed in this forum. You can check it here:

https://www.outsystems.com/forums/discussion/54354/reactive-web-and-multi-tenant/

https://www.outsystems.com/forums/discussion/65529/change-tenant-is-not-keep-in-reactive-application/


Hope this info can help you.


Best regards,

Ricardo Pereira

2022-02-20 02-44-30
Radhika K P

Hi Ricardo, 

Thanks for replying. I've already checked those links. But whatever is mentioned as solution in the first case(having server side aggregates) is not working for me unless I put the filter on aggregate as Site.TenantId = Contact.TenantId. So, that means default support for reactive is not available, right.

2021-06-02 20-50-04
Márcio Carvalho
Solution

https://www.outsystems.com/forums/discussion/46284/multitenancy/

Check this. I don't have experience in multitenant, but this answer maybe answer your "problem", in case you have changed the table setting to display the tenant ID.

"Since you choose to expose the TenantID of entities, by checking the "Show Tenant Identifier" you lose the automatic parts of the Outsystems that insert that value on creating and filter on aggregates. Only in rare cases you check this option. In your case or you uncheck this and you let Outsystems handle TenantId for you or if you really want to have this checked you need to handle it yourself. "


2022-02-20 02-44-30
Radhika K P

Thanks Marcio. That exactly was the problem. Once 'expose tenant id' was turned off, everything started working as expected. That was such a small thing that made a big difference. Thanks once again. Marked your reply as solution.

2023-08-25 08-57-29
Johan den Ouden

The big issue is that multitenancy is not support for anonymous users in reactive but only for logged in users.
In tranditional you can do a TenantSwitch (for example in the preparation of a screen based on something in the URL) and from than moment the tenant is set will be the active tenant for the session of the user.
Althought the action is still there in reactive it doesn't work. You have to do a TenantSwitch before every server actions. 
Then tenant is ignored in aggregates etc, etc. 
Me - and several other MVP's have given use cases to OutSystems why this should also work for reactive. Imagine a marketplace on internet for different countries = different tenants. People don't want to make an account first and login to see the products for a specific tenant. They want to see the products first and only make an account when they actually want to buy something.
OutSystems tell this is how multitenancy works, only for logged in users and I am lucky it works for anonymous users in trandional. So please be aware of this. You have to do a lot tricks and extra coding to support anonymous users.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.