Jump to content

Help with Accounts, Scripts and Find Commands


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

Recommended Posts

  • Newbies

Hi all!

I have a very flat table of information I'd like to make available to employees. I'd like them to login with their own account, and have FMP find only their records, and let them print, but not allow them to see other records (of other employees).

Is there a simple script way to allow access only to a found set on login?

I'd love to see this happen: user A logs in, a find command happens for all user A records. User B logs in and sees only a list of User B records.

I'd think that would be defined via the accounts and a Script of some sort. Any ideas or resources would be welcome!



Link to comment
Share on other sites

  • Newbies

Hey there,

I've spent some time with your solution, and I"m wondering if it might be too much for the db I'm creating. I have a flat db, with specific data that is imported to it.

I'd like to have an opening Script that gets the AccountName and then finds the records that match the AccountName to one of the fields in the table (i made sure the AccountName and field will have the same data).

I'm looking for some syntax, though. I'm so new to scripting FMP, that I'm just not sure what to put in there. In plain english, I need these steps:

1 - Login

2 - Get AccountName

3 - Find all records where AccountName is the same as Field X

4 - Show Found Set

Any ideas, or other threads to look at?



Link to comment
Share on other sites

Simplest script, let's name it "Find My Records":

Enter Find Mode

Set Field [ Field X; Get (AccountName) ]

Perform Find

The Get (AccountName) function is available in Find mode.

To have it run on opeing the file; go to File menu, File Options, "When opening this file" [x] Perform script, "Find My Records"

FYI, there is also an auto-enter option, down at the bottom of the auto-enter data (CreationDate, etc.), for "Account Name". This allows you to automatically tag records which people create; if you want to do that. It should be a Text field.

Link to comment
Share on other sites

This topic is 6070 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
  • Create New...

Important Information

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