Forum Discussion

JavierMartinez's avatar
JavierMartinez
Qrew Cadet
7 years ago

Roles/Home Pages

Hello everyone!

I finished building my first app and I am now starting to build roles/home pages.  We have a need for 100 roles and 100 home pages.  I'm thinking there must be a simpler way to do this.  It would be a nightmare trying to maintain 100 home pages and 500 reports (each home page will have five reports).  Is there a way to only create one role and one home page where the role will display only records based on a user's location and the home page will only display the reports based on the user's location too?

Thank you in advance!
  • SuryaExpert's avatar
    SuryaExpert
    Qrew Assistant Captain
    What do you mean by user's location? Did you mean the user's role?
    • JavierMartinez's avatar
      JavierMartinez
      Qrew Cadet
      No, we have 100 different locations.  Records can be created by users in these locations.
  • Hi Javier, 

    Congratulations on building your first app! For the 100 roles/home pages, do you need them because you have over a 100 locations? Would there be a logic to how a user is assigned to a record? Perhaps a field where a user is assigned to a record that would show what records were relevant to that which user? 
  • The right way to do this is to have a table of users and their location.  The Key field to that user should be the Userid field.

    Then on any table where you need to control access you create a formula user field called [Current User] with a formula of

    User()

    That function will calculate to the current user.  Then lookup the location down to the details table.

    Then set up Role Permission with a Custom Rule for these users which are restricted by userid location.  Maybe that would be a good name for the Role. "Restricted by userid location"

    The Custom Rule would be where [location lookup] = location.

    Then you just need 1 Role for those 100 users and 1 Dashboard and one set of those 5 reports.




    • JavierMartinez's avatar
      JavierMartinez
      Qrew Cadet
      Thank you very much!  I created the formula user field and it's pulling the user's name.  Can you clarify one thing for me please? 

      "That function will calculate to the current user.  Then lookup the location down to the details table."

      How do I do this part?  My apologies, still kind of new to this.
    • QuickBaseCoachD's avatar
      QuickBaseCoachD
      Qrew Captain
      np, I did leave out a step.

      After reconfirming that you haver set the Key field of the Users table to be the userid field, you will make a Relationship between the the Users table  and the details table.  Do not let the system make the field called [Related User] when you are building that relationship, but instead select the field you created called [Current user].

      Feel free to post back if you have any problems.
    • JavierMartinez's avatar
      JavierMartinez
      Qrew Cadet
      I don't see the userid field in the Users Table.  I currently have Employee Number as the Key Field