Show Users in Dropdowns for Multi-tenancy Accounts

Have users show up in Assigned To dropdown fields for different tenants.

Updated over a week ago

For multi-tenant accounts, you can have users access different tenants other than the tenant they were initially invited to.

In fact, in a multi-tenant account, all tenants share data. However, due to the restrictions tenant accounts impose, tenants do not have permission to show data of other tenants.

Although this article specifically pinpoints why users don't show up in dropdowns for accounts with multi-tenancy, there is a lot more to take into consideration when customizing these accounts.

It is highly suggested to contact our Professional Services team to customize your multi-tenant account for you. However, if you are interested in a quick solution, or understanding why users don't show, this article will get you started.


The Problem

A tenant account will only know about users invited to itself.

If you add a user to an account by editing the user and adding it to another tenant, that tenant will not know that user exists. For example, the tenant account will not show the user in any of the Assigned To dropdowns.

Imagine Method user Errol was initially invited to a franchise called WestFranchise.

And then the user Errol was edited so they can access an additional tenant called EastFranchise.

When in the tenant EastFranchise and trying to add an activity, the user Errol does not show up in the Assigned To dropdown:


The Reason

Every tenant account filters to only look at records created in itself.

In our dropdown example, it automatically filters the User table to only include users invited to itself. Users invited to other tenants will be filtered out. In fact, this is not just with users. This applies to all records.

To get more technical, every action and every object has a built-in criteria to check if its associated TenantID field equals the current tenant. This criteria does not show, however, it is automatically built in.

For example, if you want to retrieve values from the Invoice table, it will automatically check if the Invoice's TenantID field equals the current Tenant. However, this criteria does not appear in the action. In the below image, note there is only one shown criteria: the RecordID = Screen Active Record ID, but there is a hidden, automatic criteria to filter for the TenantID.


The Solution

You need to override the built-in criteria that filters for the current TenantID.

This solution is not an easy solution because it requires you to customize every screen and every object where you want to override this tenant filter. There is no global way to overried this built-in filter.

So if you want to show all users in the Assigned To of the Invoice screen, you will need to customize the New / Edit Invoice screen. However, if you also want all users to show in the Estimate screen, you'll need to also customize the New / Edit Estimate screen.

Furthermore, due to the complexity of some screens, it is difficult to find what exactly is affected by this built-in filter.

This article will cover the easiest way to show all users in a dropdown, however, this doesn't mean other functionality will continue to work.

For our scenario, we will customize the Activity screen to show all users in the Assigned To dropdown.

Customizing a Simple Solution for the Dropdown

Every user has a TenantID field which holds the tenant they were first invited to. The Assigned To dropdown will automatically filter out any User with a TenantID not equal to the current tenant. This solution will override that filter.

  1. Create or edit an Activity.

  2. At the top, click the down arrow icon by the Activities header and then click Customize Screen.

  3. You will be notified that the screen is in read-only mode. Click the Edit button.

  4. Since the screen is one of our stock screens, you will be asked to create a copy of it. Click Create copy.

  5. Scroll down until you find AssignedTo dropdown control in the secDetailsContact section.

  6. Click the down arrowby AssignedTo and then selectViews.

  7. This screen will allow you to alter what gets filtered in the Assigned To dropdown. We need to account for two cases, so on the right, under View Properties - Selection Criteria, click βŠ• Add another group.

  8. Now within this new group, add the first condition:

    • First dropdown: TenantID

    • Second dropdown: Greater Than

    • Third dropdown: Number

    • Fourth dropdown: Keep the default of 0 .

  9. There is another situation we need to account for, if the TenantID on the user is blank. To add another condition, hover over the second line and click the βŠ• icon to embed another condition.

  10. Now add this second condition in:

    • First dropdown: TenantID

    • Second dropdown: Is Empty

  11. By the way, did you notice the blue vertical line that stretches from 2 to 4? If that blue line does not encase the last condition, then you have added the condition incorrectly.

  12. Finally, the If All statement indicates that both line 3 and line 4 must be true in order to show a user. This, of course, is impossible. The TenantID can't be a number and also blank at the same time. So change the "All" dropdown to "Any".

  13. At the top of the screen, click Close.

  14. Again, at the top of the screen, click Close to close customization.

You have finished customizing the dropdown. Instead of only showing a User with a TenantID equal to the current tenant, you have changed it to show a user with any TenantID or a user with a blank TenantID.

In effect, it will now show all users from all tenants.

Cons to this Simple Solution

Although this may seem to work on the surface, there are ramifications you should consider for futher customization.

  • The dropdown shows all users across all tenants, even users who have not been added to the tenant. If you assign an activity to them, they won't be able to see it because they aren't on the tenant.

  • There are buttons and objects on the screen that still filter for the current tenant. For example, when selecting the user, the Notify Assigned To checkbox disappears. This is because when you select a user, it will attempt to find the user's email address, but it won't find it because, again, the Retrieve values from table action will filter to the current tenant.

  • If you want this to apply another screen, you will need to redo these steps again for every screen.

  • For other apps and other records, if you are not careful, you may expose records to other users you did not intend.

Solution for Notifying the Assigned To

As mentioned in the previous section, the Notify Assigned To disappears when you select a non-local tenant.

To fix this, we will need to update the actions which cause it to disappear. This happens when the user changes the Assigned To dropdown, which indicates this is done in the dropdown's Change event.

  1. Still in the same New / Edit Activity screen, click the down arrow icon by the Activities header and then click Customize Screen.

  2. Scroll down back to the AssignedTo dropdown control in the secDetailsContact section.

  3. Click the down arrowby AssignedTo but this time select its Change event.

  4. In this action set, select the second action, Retrieve Values From Table.

  5. On the right, click Edit criteria.

  6. This should look familiar! Click βŠ• Add another group.

  7. And now do the same steps from the previous section (8 to 10) to add in the same two conditions to this action.

  8. Now click Close to close the action set and then click Close again to close the designer.

And now, when you select a user not initially part of the tenant, the Notify Assigned To checkbox will not disappear.

Publishing Draft Version to a Live Version

Once you are satisifed with the customizations, you will need to publish them. Remember, all customizations done will be available to every tenant in the account. However, you will need to publish the version since it's currently in draft mode.

First, as a best practice, you should put in some internal notes, as well as notes on the screen to indicate what you did.

  1. Customize the same New / Edit Activity screen.

  2. Select the page icon on the Properties panel.

  3. Under Internal notes, write something similar to "Updated Assigned To's View filter and Change event to allow for all tenant users".

  4. Click Save and then Close to close the customization designer.

  5. The top of the screen has a blue banner indicating your screen is still in draft mode. Select click here on the blue banner.

  6. See your version notes? Those are helpful. Anyway, click the Publish button.

  7. It will ask if you are sure so click Publish again.

  8. Your screen is published and viewable to all accounts now.

Conclusion

Now that you have completed this, you have an idea of what customizing a Multi-tenant account is like. As mentioned before, similar customization will need to be done for all screens to override the TenantID filter can take considerable time and effort to implement.

Again, we highly suggest you reach out to our Professional Services team to customize your multi-tenant account for you.

Did this answer your question?