Jump to content

Possible to have unique users only see certain records?


HX_Guy
 Share

This topic is 2777 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I'm looking to setup a solution for sales reps via WebDirect to where each sales rep can login but only be able to view records assigned to them.

How difficult would this be to setup? 

Right now I have a layout that has a drop down with each sales rep name. Could I make additional layouts and have some sort of identifier for each sales rep and then when they log in with their user, that user is only allowed access to that layout/records?

Link to comment
Share on other sites

It's very possible to do this.  But it has next to nothing to do with Layouts.  This process is called Record Level Access.  Basically the way it works is that when some test is met, the user can see the record or do something to or with it. This is set up in the Manage Security area in the Privilege Set definition.  Check FMF here for Record Level Access threads.

 

Steven

Link to comment
Share on other sites

Coupled with RLA, you will also build your navigation system so that users are kept to "their world."

"Could I make additional layouts and have some sort of identifier for each sales rep and then when they log in with their user, that user is only allowed access to that layout/records?"

 

Absolutely! Each sales rep would have a record in a People table (Staff table, if you'd prefer). That record would have a field account name, and you'd find that record on file open. See this demo. http://fmforums.com/forum/topic/95513-restrict-login-to-specific-account/?p=437878

Link to comment
Share on other sites

  • 3 weeks later...

Thanks for the replies so far. I haven't quite got around to the Sales Rep thing but this is pretty much the same thing, just with a different field.

Over on another forum, someone said to use a formula so that it restricts the privilege to only show records that match a certain "Get". Not sure what I'm doing wrong but getting an error. 
I want to set the privilege that it only shows records where Type = Sale (values include "Active Lead", "Dead Lead" and "Sale").

 

 Boolean.jpg

Link to comment
Share on other sites

Awesome! It works! :D Now of course, one things leads to another...

The records are still present, but show No Access in all fields. How do I go about automatically omitting the records that I don't want the user to see when they log in?

Link to comment
Share on other sites

You don't have to do anything for a specific user in the startup script. If you set your startup script to do a Find for * -- i.e., an asterisk -- in a field that always has data (the primary key field is a good bet), then FileMaker will return only the records the user's security settings allow.

Note that the Find All command does not work this way -- it will include "no access" records.

If you want to branch your logic for specific users, though, it is possible using Get(CurrentPrivilegeSetName), Get(AccountName) etc.

Link to comment
Share on other sites

Yeah, that's what Im running into that the command works and X user can only see data in records where Type = Sale...but they can still see all record counts even though all the data fields say No Access. 

As an example, I have a total of 15 records. 12 are Sale and 3 are Active Lead. Right now, when X user logs in, they see there are 15 records. If they starting going to each one by one, they see the data in the records that have Type = Sale, and then when they get to Type = Active Lead, they just see No Access. 

I'd like when X user logs in, for the total record count to just say 12 and for X user to not even be aware of the total number of records. Does that make sense?

Link to comment
Share on other sites

That will take some extra work: you'll need to hide/lock the toolbar and provide your own navigation buttons.

Link to comment
Share on other sites

when they get to Type = Active Lead, they just see No Access. 

​That's because you did not perform a find. If you had, they would see that there are 12 records found (out of 15 total), and they would never get to a <No Access> record by browsing. The only way they could get to them is by doing Show Omitted Only or Show All Records - two commands which they should not be able to call.

Link to comment
Share on other sites

That's still script based though right? Above said that I don't have to do a script for a specific user, just a startup script for Find *. But then won't all users run that script when they login? 

I as the Admin want to see all records all the time, I just want X user that logs in via Webdirect to see only records where Type = Sale. 

Link to comment
Share on other sites

But then won't all users run that script when they login?

​Yes, they will. So? If the script performs a "bogus" find (i.e. searches for * in a field that cannot be empty), then you as the Admin will find all records. In addition, the script can look at the current user's privilege set and tailor the search criteria accordingly. Or not perform the search at all, if the user is Admin. Or perform the search only if the user is logged in via WebDirect. It's a script: it can do anything you want it to do, when you want it . Take control.

Link to comment
Share on other sites

This topic is 2777 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.