Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

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

Recommended Posts

Posted

probably a simple question...

but what I'd like to know is how to set a field's value based on the Privilege Set that a user is a member of...

For instance, user A is a Member of Privilege Set A..so upon logging in...any new records created automatically set the Location field to A...etc..etc..

Thhnx in advance

Posted

Hmm...not sure I understand that.

sorry to be so obtuse.

I have a field in my Db called Location that uses a value list. Denver, New York etc...

I'd like to make it so that when a user logs in that is part of say the Denver privilege set...the Location field automatically gets set to Denver when they create a new record...if they're part of the New York set it gets set to New York.

is get(privilegesetname) a valid function parameter? I'm not familiar with it.

Posted

Do you have a users table? If so, use an Open Script that finds the User using Get (accountname) and then publishes their locationID to gLocationID. Btw, I would not use New York, Denver, but rather IDs that come from the Locations table.

In each table, create a LocationIDCreated field that has as an auto-enter calc, gLocationID.

Posted

uh...I don't have anything quite so complex.

I have no users table or locations table

The users are setup using Filemaker's default Manage Security.

And the locations are in a simple value list at the moment.

Posted

You could put a LocationCreated field in each table, auto-enter calc, and a case statement, but that will spread your logic out. For example, if you decided that you want to change the Location that is associated with a privset in new records, you'd have to change every calc field in every table.

This isn't hard. Create a Locations table, LocationID and Location. Use that to create the value list, just showing the second field.

Create a user table. Now you can directly tie Users and Locations with a LocationID in the User table. Also create an AccountName in the User table and enter their accountname. I also include PrivSet, but that's bcs I script Account creation.

In a script that runs on Open, go to a layout based on Users, enter Find mode and set AccountName to Get(accountname). Perform Find. Now you're at the user record, at can set all sorts of values to global fields or $$vars.

Posted

Alright. Keeping it simple.

Yes, in a startup script, create a section:

If ( Get (PrivilegeSetName) = X

Set $$location, "New York"

elseif ( get (privsetname) = Y

Set $$location, "London"

etc

endif

Then, in each table, you'd have a LocationCreated field with an auto-enter, $$location.

This topic is 5242 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.