Skip to main content
Known Participant
Jul 14, 2023 11:40 AM UTC
Question

Assign fields depending on the logged user

Hi! I would want to filter a site (record security) based on user conditions. When the user enters, I want to assign him a supplier name and a NIF, and then use this data interfaces to filter. Which would be your best-practice advices?

    4 replies

    stefanhelzle0001
    Brainy
    Jul 14, 2023 11:49 AM UTC

    Can you explain what you want to achieve?

    What does "filter a site" mean?

    Where does record security come into play?

    Why is all of this relevant to fetching data and populating a form at initial load time?

    Known Participant
    Jul 14, 2023 12:40 PM UTC

    Filter site = Record security rules/expression

    I want to create a supplier site in which the record is filtered depending on the user and their conditions

    For your understanding, I explain you a use case:

    - I enter as my username, and I want to be associated with me the following fields:

    1) SupplierName: Proveedor 1

    2) NIF: (integer)

    - After that, I have another record with Supplier Names and NIF data. And I want to use this related info to make a query filter in the record (when I enter as Proveedor 1, with the NIF "X", I want my record to be filtered with NIF = X, or with Supplier Name = Proveedor 1)

    mathieud0001
    Genius
    Jul 14, 2023 11:58 AM UTC

    I would store those preferences in a table along with their user name. You can then set your Record secruity and filters based on those preferences.

    Known Participant
    Jul 14, 2023 12:42 PM UTC

    Thanks, and how do you recommend me to make the "Username- supplier-NIF" master? I have only created databases from scratch and filled them with input tasks (interfaces)

    And how can I refer to the relation made in the master in the record security expression? For now I just used this (allows to make a filter based directly on the username, not in related fields)