[Application Framework] Application Framework.  Can anyone explain to me what this code does ?
application-framework
Reactive icon
Forge component by Justin James
Application Type
Reactive

Hello, 


Im studing this module to learn how to deal with tentants.

But I do not see what this code is exactly doing 


Can someone explain this to me ?

mvp_badge
MVP

First, it finds the Tenant record, and changes it's name to the "Public Name" in TenantExtended (after doing some processing to remove characters and formatting not allowed in Tenant.Name). Then if the NameFormat in Tenant Extended has changed, it finds all users in the tenant and updates their names to use the new name format.

J.Ja

Thanks,

I wonder if I really need the name format thing.

And what is the difference between User and MTUsers that you use on the code ?



mvp_badge
MVP

It's useful for applications that can be used by different cultures, or who have their own organizational way of doing things. If I was making a SaaS B2B product, 100% I would use it. If I was making an internal enterprise tool and I knew it would only be used in one country, I wouldn't use it.

J.Ja

oke, so I can use the User internal tabel provided by Outsystems itself?

mvp_badge
MVP

You should always have a UserExtended and a TenantExtended table to add onto the internal User and Tenant tables. Their tables don't have nearly all of the fields you will need to manage users and tenants, and having the ability to join to the extended tables to find which users and tenants were created by your app is very important and useful.

J.Ja

I know and I have them.

So I need to use the User and Userextented table to store there the cleaned up name ?

instead of the MTuserTable


It look to me you were using a 1 - 1 where I think I need a 1 - n
or am i mistaken ?

mvp_badge
MVP

A few things to help this be a little more clear:

* These must be 1:1, if they are 1:N it will be a disaster. The last thing you want are duplicates in an Extension Entity. OutSystems naming convention is that anything with "Extended" in the Entity name is an Extension with a 1:1 relationship to what it extends.

* The cleaned up name is in MTUser; UserExtended stores the given name and the family name separately which is how it is able to come up with the properly formatted name to put into MTUser.

* In case you were not aware, MTUser is a very unique Entity; it is the exact same physical table that User is mapped to, but with the tenant id exposed, working in MTUser and User affect the exact same records.

J.Ja

oke, 


But with the neo challenge for my feeling a friends can be in several groups.
or am I mistaken here?

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