Multiple If Statement, UserRole, Images Question

Multiple If Statement, UserRole, Images Question

I have a project that will be used by different companies.

I assigned users to their respective Roles (CompanyA, CompanyB, CompanyC, etc...)

Base on whoever logged in, the application should display their respective company logo image

I was thinking something like

if checkrole(userid) = 'CompanyA' then imageWidget = ....
else if checkrole(userid) = 'CompanyB' then imageWidget = ....

/* checkrole returns the role name */

Something like this or is there better way to do it


David -

That's not the best way to do it. A much better approach is to use the multi-tenancy feature, which will completely separate the data, users, etc. for each of those different companies. We use an entity we created called TenantExtended, and there's only 1 record per tenant, for tenant-specific settings like logos and such.

As Justin advised, you should consider multi-tenancy.
To learn more about what it is, check the reference help.

You should also take a look at the How to Built a Multi Tenant Application technical note. It contains an example application that you can inspect and change.