Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Layout re-direct on open script

Featured Replies

Hello world:

Anybody able to point me in the direction of how I can re-direct a user to a certain layout based on their machine name? I would like to do this in the open script as to avoid a login. (for the time being) Managers, Production, Sales, and us Techies, share the same data but have different uses for it. Thanks so much for ANY feedback.

Cheers and Beers

Andrew

Hi Andrew,

It can be hard coded, like this:

If ["Status(CurrentUserName) = "FirstWorkstation" "]

Go To Layout ["Layout 1"]

Else

If ["Status(CurrentUserName) = "SecondWorkstation" "]

Go To Layout ["Layout 2"]

Else

If ["Status(CurrentUserName) = "ThirdWorkstation" "]

Go To Layout ["Layout 3"]

End If

End If

End If

But if you have a lot of workstations and/or a lot of layouts, it will be tedious to code and maintain. In which case, I'd recommend that you make the process relationship driven.

That would entail creating a file with two fields - 'WorksationName' (a text field) and DefaultLayout (a number field) in which you store the name of each workstation, and the number of the layout you want it to start on - one record for each workstation.

Then in your main file, create a global text field called 'gWorkstationID', and a relationship called 'WorkstationData' which matches the gWorkstationID field to the WorkstationName field in your reference file.

With the above in place, your start-up script can simple include the following:

Set Field ["gWorkstationID", "Status(CurrentUserName)"]

Go to Layout ["WorkstationData::DefaultLayout"]

which will look up the appropriate layout for the current workstation from the reference file and take the user to it.

The advantage of this approach is partly that it is easy to script, but more importantly, it is very easy to add unlimited numbers of new workstations, and/or edit the default layouts assigned to them. cool.gif

  • Author

Awesome!!!! Thank-you...now to look at the names of several hundred workstations...lol

I knew there HAD to be a way

Cheers and a cold Fosters to ya mate!!!

andrew

Fosters? I wouldn't wish that on anyone!

As the FM user name can be changed by users, is there a way I can use something more robust, like the machine's IP or another identifier?

cheers,

Wendy

Hi Wendy,

There are several ways to make systems such as layout switching more secure.

The 'conventional' way is to use the inbuilt access privileges. To do this, you would ensure that each user has a password which is assigned to a group according to which layout/s he/she should be directed to. These can be additional groups without any specific privileges attached, that simply refer to layout preferences - so if you already have groups assigned for other purposes, you can simply add to what is there (giving each user an extra group) rather than rebuilding it on different principles.

Once the user access privileges are configured appropriately, you would be able to use a script sequence along the lines of:

If ["PatternCount(Status(CurrentGroups), "Managers")"]

Go To Layout ["Administrative Overvieww"]

Els

If ["PatternCount(Status(CurrentGroups), "Marketing")"]

Go To Layout ["Summary Reports"]

Else

If ["PatternCount(Status(CurrentGroups), "Admin")"]

Go To Layout ["Data Entry"]

End If

End If

End If

Or - using the relational model I was discussing with Andrew, you would establish a related resources file of group configurations and their associated layout numbers, then use something like:

Set Field ["gWorkstationID", "Status(CurrentGroups)"]

Go to Layout ["WorkstationData::DefaultLayout"]

However since a user can be in more than one group, you will have to deal with the fact that by either ensuring that in such cases, only one of the groups is listed in the reference file - or that the WorkstationData relationship has a sort order specified (eg a custom sort order by layout) which enables the appropriate default to be chosen when more than one related record is accessed.

Beyond that, there are various security options involving plug-ins and/or custom login implementations (including third-party products that will retrieve the machine IP or the hard drive serial# etc). But hopefully the above has given you some ideas to work with?! wink.gif

  • Author

Hmmmm....food for thought.

Gives me something to mull over while commuting.

Thank-you, and if not Foster's in Australia, then which beer? LOL

Cheers

Andrew

We only export the bad stuff, mate - we keep all the good beers for ourselves. smirk.gif For some reason the Poms seem to love our Fosters confused.gif but you wouldn't find an Aussie who admits to drinking it.

cheers (& beers)

Wendy

Foster's has a terrific ad agency, and in case you don't think Americans are susceptible to advertising, just look at who's inhabiting the White House (I refuse to call that idiot the President).

Oooh, I'm gonna get sued!

I don't think you are suppose to discuss politic on this list. So take you political thoughs and shove them where the sun don't shine

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.