Record access based on logged in user

Posted on 2012-09-18
Last Modified: 2012-09-27
Hi, I am trying to create a Filemaker 11 db application that will display records based on the user logged in.  I am coming from a .net/sql server web background.
I would like to have employees that log in individually and then only have access to view or update their clients. And clients can be assigned to more than one employee.  I can't figure out the piece between the login (set up under Manage -> security) and record access.  In .net I would have a client table, employee table, and a table that related the 2.  How do I accomplish the same thing in Filemaker? Thanks for any help.
Question by:farmingtonis
    LVL 1

    Accepted Solution

    You could filter the records using a script.

    Layout 1 has a button e.g. Display clients.

    Click Scripts, manage scripts.

    Then in the script use case statement of if statement

    Get(AccountName) =  "username" - this function will get the current logged on user name

    then you set find parameters based on which user is logged in.

    on the employee layout, you can create a portal.
    The portal records can be filtered.
    Create an extra field in the employee table called "Owner" or "BelongsTo"
    In here you specify the username/account name that this belongs to.

    In the portal specify a filter to filter portal records to only display clients where "Owner" = Get(AccoutnName)

    With regards to the table relationships, this is quite straight forward. Obviously you will be experience with primary and foreign keys.

    in Filemaker, click File, manage, database

    create the tables and fields along with PK and FKs

    then click the relation ship tab. You will see instances of the tables, you can then drag relationships between the tables from PK to FK,

    One  to many relationships are simple to implement but filemaker provides various options for more complex relationships.

    that should get you started, let me know if you need any further pointers.

    Author Comment

    What if in Option 2 there is more than one possible employee.  What if a client can have more than one employee associated with them and employees have more than one client. How do I handle that relationship in either option 1 or 2. thanks.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Pop up windows can be a useful feature of any Filemaker database.  Though best used sparingly, they can be employed in a multitude of different ways, for example;  as a splash screen at login, during scripted processes to control user input, as pick…
    Conversion Steps for merging and consolidating separate Filemaker files The following is a step-by-step guide for the process of consolidating two or more FileMaker files (version 7 and later) into a single file with multiple tables. Sometimes th…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now