Alpha Video Training
Results 1 to 3 of 3

Thread: Tenant ID is not mapping with the login

  1. #1
    Member
    Real Name
    Gary Coslop
    Join Date
    Sep 2019
    Posts
    22

    Default Tenant ID is not mapping with the login

    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.

  2. #2
    "Certified" Alphaholic
    Real Name
    Larry Grupido
    Join Date
    May 2010
    Posts
    1,813

    Default Re: Tenant ID is not mapping with the login

    I don't understand what you are trying to do here. I have not used the extended user info as all of my systems have their own "extended info" built in.

    I do know that trying to change the connection string for a web security table can be a big pain.

    But I would be willing to spend some time looking over your work with a pair of fresh eyes in a team viewer session if you are interested.

  3. #3
    Member
    Real Name
    Gary Coslop
    Join Date
    Sep 2019
    Posts
    22

    Default Re: Tenant ID is not mapping with the login

    I absolutely would be willing and interested in a fresh set of eyes looking at it. I don't doubt that looking at it as long as I have is making my eyes blurry. That would be great.

    I am attempting to create a multi-tenant database (where tenantid is unique to the agency, and the login name maps to the tenantid in an extended user info table). I followed the videos in https://documentation.alphasoftware....Connection.xml and I tried the advice in https://forum.alphasoftware.com/show...antidfieldtype which still seems to have the same issues as this person described in 11-19-2018.

    I must be overlooking something simple (or not so simple) because it is not reading that tenantid based on the login.

Similar Threads

  1. How do you set numbering in multi-tenant apps?
    By WindForce in forum Mobile & Browser Applications
    Replies: 2
    Last Post: 10-06-2019, 02:30 PM
  2. Pre-release Multi-Tenant Connection String
    By Davidk in forum Mobile & Browser Applications
    Replies: 24
    Last Post: 11-20-2018, 02:55 AM
  3. Multi Tenant Auto Increment
    By beau79 in forum Application Server Version 11 - Web/Browser Applications
    Replies: 17
    Last Post: 12-11-2017, 12:45 AM
  4. How to bulid multi Tenant application
    By eduduru in forum Database Design
    Replies: 6
    Last Post: 04-11-2016, 04:37 PM
  5. Multi-tenant Web app
    By blancolandau in forum Application Server Version 10 - Web/Browser Applications
    Replies: 2
    Last Post: 12-20-2010, 10:49 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •