I am having trouble getting Alpha to write the tenantid when it writes information to a table. Just the same, it is not retrieving rows of data based on the tenantid.
I have 2 databases. One is for user info (including the websecurity tables assigned when setting up web security. The other is for the data. Let’s call them users and data. I then went to AlphaDAO (where I created the table connections) and created 2 new connections with the same names. I selected MultiTenant then the users database. I linked Tenant ID and Session Variable to “tenantid” and I now have 2 other connections called usersmt and datamt. I also have a table called “extendeduserinfo” that has a “userid” and “tenantid” column (among a few other columns).
Under Web Security I went to “Extended User-info Table” link at the bottom. There, the table name is “extendeduserinfo” and the userid field name is “userid”. I am also using a UX security component template “SecurityFramework-Edit_ExtendedUserInfo.”
If the Web Security “Security Table Type” (SQL) is set to usersmt, I get an error when it tries to write the websecurity tables. It says “Creating New Web Security Tables Error 0 – Error parsing SQL statement 7 – ‘line 1:1: unexpected token: CREATE’. If I select users (without the mt) it runs fine.
The paragraph above now has the “users” and not “usersmt” so the tables were created.
If the “Extended User-info Table” (under Web Security) connection string was usersmt (the new multi-tenant connection), and I publish, refresh, login, and run the UX component, it says “Editing Extended User Information for (login name), however no fields are visible. If I change the connection to users (and not usersmt) it lists every field for that user on the table including tenantid.
So now I have both security settings set to users because usersmt doesn’t play well with me. Now I have 2 different grids. Grid “nomt” uses the data connection string and Grid “yesmt” uses the datamt connection string. Nomt shows me every row no matter what the tenantid column says. Yesmt shows me nothing no matter if the tenantid column has a name that matches in the “extendedUserInfo” table.
So now I create a row in each table. Both create, and the tenantid column is blank (not null; just blank) when I look at them in the database. When I view the table again, I get the same result in grid nomt, but in yesmt I get the row I just created, but nothing else. This row has an empty “tenantid” (again, not null; just empty), and the reference table I created has the name “agency” for this login under the tenantid column.
This was in 'character' in the tenantid. I also modified "myconnection.multitenant.a5xbclass" to correct the quote issue around the wherestatement on line 166. That did not resolve the problem either.
So then I changed SQL tenantid to integer, and I made companies 1 and 2. Login was mapped to company one, however when I did a query, it returned nothing. When I created a new record with that login (mapped to tenantid 1) it created tenantid 0 for it. It seems as though it is not mapping correctly.
I hope that all made sense. I am lost and struggling, so help is greatly appreciated. I feel like the answer is simple, and I am overlooking it.
I have 2 databases. One is for user info (including the websecurity tables assigned when setting up web security. The other is for the data. Let’s call them users and data. I then went to AlphaDAO (where I created the table connections) and created 2 new connections with the same names. I selected MultiTenant then the users database. I linked Tenant ID and Session Variable to “tenantid” and I now have 2 other connections called usersmt and datamt. I also have a table called “extendeduserinfo” that has a “userid” and “tenantid” column (among a few other columns).
Under Web Security I went to “Extended User-info Table” link at the bottom. There, the table name is “extendeduserinfo” and the userid field name is “userid”. I am also using a UX security component template “SecurityFramework-Edit_ExtendedUserInfo.”
If the Web Security “Security Table Type” (SQL) is set to usersmt, I get an error when it tries to write the websecurity tables. It says “Creating New Web Security Tables Error 0 – Error parsing SQL statement 7 – ‘line 1:1: unexpected token: CREATE’. If I select users (without the mt) it runs fine.
The paragraph above now has the “users” and not “usersmt” so the tables were created.
If the “Extended User-info Table” (under Web Security) connection string was usersmt (the new multi-tenant connection), and I publish, refresh, login, and run the UX component, it says “Editing Extended User Information for (login name), however no fields are visible. If I change the connection to users (and not usersmt) it lists every field for that user on the table including tenantid.
So now I have both security settings set to users because usersmt doesn’t play well with me. Now I have 2 different grids. Grid “nomt” uses the data connection string and Grid “yesmt” uses the datamt connection string. Nomt shows me every row no matter what the tenantid column says. Yesmt shows me nothing no matter if the tenantid column has a name that matches in the “extendedUserInfo” table.
So now I create a row in each table. Both create, and the tenantid column is blank (not null; just blank) when I look at them in the database. When I view the table again, I get the same result in grid nomt, but in yesmt I get the row I just created, but nothing else. This row has an empty “tenantid” (again, not null; just empty), and the reference table I created has the name “agency” for this login under the tenantid column.
This was in 'character' in the tenantid. I also modified "myconnection.multitenant.a5xbclass" to correct the quote issue around the wherestatement on line 166. That did not resolve the problem either.
So then I changed SQL tenantid to integer, and I made companies 1 and 2. Login was mapped to company one, however when I did a query, it returned nothing. When I created a new record with that login (mapped to tenantid 1) it created tenantid 0 for it. It seems as though it is not mapping correctly.
I hope that all made sense. I am lost and struggling, so help is greatly appreciated. I feel like the answer is simple, and I am overlooking it.
Comment