Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

I have a db which can be opened with several accounts with different privilege sets. I would like to set it up so that it opens to a specific layout depending on the user name.

Ie.

Admin would log in and see the Master DB layout

Tech would log in and see the Maintenance DB layout

Is this possible?

Posted

Create a script and then run it when the file opens.

File>File Options: Open/Close Tab, check the Perform Script box and select the script to run.

Posted

The script that runs on Open System would have a section such as (pseudo-script) :)

If Get (AccountName) = "Admin"

Go to Layout (Master DB Layout)

elseif get (accountname) = "Tech"

Go to Layout ( Maintenance DB layout)

else

Go to Layout ( User Main Main)

endif

Posted

How do I get the field AccountName to reflect the current user?

I tried using gUsername field and my script looks like this but always opens with Master DB layout.

Insert Current User Name [select; Users::gUsername]

If (gUsername) = "Admin"

Go to Layout (Master DB Layout)

elseif (Username) = "Tech"

Go to Layout ( Maintenance DB layout)

endif

Posted

My script works as is without the use of a global.

There is no field AccountName.

You do have users login on startup, right?

Remember, AccountName is what is entered in the login dialog, but UserName is what is entered in FM's Edit Preferences (and is really never used).

Posted

Thank you. I got it to work. The final script looks like this.

If [Get (AccountName) = "Admin"]

Go to Layout (Master DB Layout)

elseif [get (accountname) = "Tech"]

Go to Layout ( Maintenance DB layout)

else

Go to Layout ( User Main Main)

endif

Thanks again for your help.

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