addtableFilterParam

Hi

I am building web client application, full multi-tenant and i want to restrict the users to seeing only their companies data.

I have a company_id field in most tables.

On a successful custom login i set their company_id into a global and then use databasemanager fx to lock the foundset for these tables

var id = globals.user_company_id;
var success = databaseManager.addTableFilterParam(servername, null, ‘company_id’, ‘=’, id);

this works in all tables except 1! The table is called ‘user_accounts’ i have the company_id in this table but i can always see all records. All other tables lock into that company_id data perfectly as expected.

The company_id is an integer.

Any help would be appreciated.

Rodney,

Table filters have to be applied before forms are loaded to be effective.
Is the form that does not apply the filter used in the login?

Note that release 4 will have a more flexible table filter implementation:

  • filters can be applied at any time and will be effective on all existing forms
  • filters can be removed

Rob

Hi Rob

Yes it is!

The login form uses the user accounts table. On a successful login it then fires the opening method which contains the table filter.

I will change this login form to another table and this should correct the filter.

Thanks so much for your help.