Somehow you'll need to identify the person's department from their log in. Account Name and PrivilegeSet name are two things you can check with a get function and either might work here.
You can perform a find to get the person's department ( and determine the appropriate layout ) or you can use a relationship.
Let's say you have Two Tables: Departments and Users.
Departments would have these fields:
DepartmentID (auto-entered serial number)
Layout Name (or you can use layout number)
Users would have these fields:
Define a global text field, gAccountName in a third table, Start (this can actually be any table, even one of the two listed above)
Define these relationships:
Start::gAccountName = Users::AccountName
Users::DepartmentID = Departments::DepartmentID
Now your start up script:
Go To layout [Start]
Set Field [Start::gAccountName ; Get ( AccountName ) ]
Go To layout [Departments::Layout Name ] // Use Layout Name by Calculation option
Thanks for your help! As Always!
After posting the forum, I thought about it a while and came up with a solution... (I think).
It actually is very similar to your solution or actually the same.
So here is what I did.
Under Fileoptions, I have it to perform a script called "Startup Script" in which it performs the following.
1) Set a global field called accountname with get(AccountName)
2) Go to layout called "layout selector"
3) In Layout: layout selector (Users Table) , I inserted 3 fields with User's full name (which is the same as the accountName), globalfield "accountname" from step 1, and department name(which user is associated).
4) I then created a layer script trigger "OnLayoutEnter" to trigger a script:
a. Find the User's record by the AccountName
b. Then get the department
c. Trigger Go To Layout by the department by If else statement.
I appreciate for the help and the input!!