Announcement

Collapse
No announcement yet.

Own Records of each user

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Own Records of each user

    Hi
    I've created a form with user data like name, email, adress, phone, etc and a grid to read them
    Other form with other data about the user, and its reading grid.

    Both forms are built in two tables, in the user table idusuario is the PK, an in the other that field (idusuario) is in:

    User table Other table
    idusuario PK Formulario PK
    Nombre Question1
    Telefono Question2
    Email idusuario
    ETC.......

    When I created the security module (after those apps), there is a user table, where you can change password, etc.
    I need to know how can I do to vinculate user table of security module with my user table (remember idusuario is the PK), and so every time user logs in, and access to both tables, can watch their own items

    Then, I also need to know how can I do If I want that every user see only his own records (in every app)
    I wrote to support system, they told me that
    For GRIDS
    In SQL Select,
    Where User = [usr_login]------------In this case, should I change User for idusuario?

    For FORMS

    In onloadevent
    {User} = [usr_login] ;---------------Do I have to change User for idusuario?

    Is this the best way to proceed?
    Thank you for your help

  • #2
    If you have a record containing a field for ownership than this field needs to comply to the logged in user. So you need to make some transformation between the user id and this owner id. If they do not match then you need some kind of translation table to convert the user id into the ownerid. But after that you can set this field to a global and use this global variable in the sql statement as you have already written. The [usr_login] is a system global containing the userid used to login.
    Albert Drent
    aducom software netherlands
    scriptcase partner, reseller, support and (turn-key) development
    www.scriptcase.eu / www.scriptcase.nl

    Comment


    • #3
      Thanks but, how can I do this?

      Comment

      Working...
      X