?
Solved

Record access based on logged in user

Posted on 2012-09-18
2
Medium Priority
?
464 Views
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.
0
Comment
Question by:farmingtonis
2 Comments
 
LVL 1

Accepted Solution

by:
jontelukltd earned 2000 total points
ID: 38412818
Option1
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.

Option2
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.
0
 

Author Comment

by:farmingtonis
ID: 38441246
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.
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Having just upgraded from Filemaker 11 to Filemaker 12 over the weekend, we thought we would add some tips for others making the same move.  In general, our installation went without incident. Please note that this is not a replacement for Chapter 5…
Screencast - Getting to Know the Pipeline
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…

840 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