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.

Start-up Script problems Help!!!

Featured Replies

I am designing a database where any layout can be reached by

choosing two pop-up numerical value lists "Stage" and "Batch".

If stage is set to 1 and batch is set to 3 then you are taken to layout 13.

If stage is set to 2 and batch is set to 4 then you are taken to layout 24.

And so on...

There is a clever Pause/resume script I am using to move between

these layouts as the value is chosen in these two fields.

So far so good...

When the database I am designing is opened I would like the

user to go to the last layout that they were working on.

How do you ensure in a startup script that if there is a value in

"stage" and "batch" (say 2 and 4 respectively) that it will go to that

layout (say layout 24) BUT... and this is a big BUT... if no entry has

been made in these fields (for instance; the very first time the database is opened)

that it will enter a default value into both of these fields and go to that layout (say layout 11).

i.e. How can I tell in a startup script if a field has ANY value in it and

act (or not) on it accordingly.

Could anybody clear this up?

In your startup script, you can set up an If [ ] test which uses the IsEmpty( ) function to test for a value in the Stage and Batch fields.

So, you need a sequence in your start-up script along the lines of:

If ["IsEmpty(Stage) or IsEmpty(Batch)"]

Set Field ["Stage", " "1"]

Set Field ["Batch", " "1"]

EndIf

Go to Layout ["StageBatch"]

where 'StageBatch' is the name of a calculating number field with the formula: Stage & Batch

  • Author

Hi Cobalt Sky,

Your solution seems to have a snag. Go to Layout ["StageBatch"] takes you to

a layout number defined by Stage & Batch (Layout No 21) not to a layout called "21"

As I now know, Layout number is not the same as a Layout name.

I thought to differentiate Layouts using a tens and units split. A simple calculation

could take any value entered in "stage", multiply it by ten and add it to the value

entered in "batch". Simple, no?. Therefore, if you entered "2" in "stage" and "1" in batch

the resulting value "stagebatch" would be "21". In order for this elegant solution

to work I would have to have 20 layouts in front of this one before Filemaker would

see this as Layout "21".

Is there ANY way of using the Go to Layout script step that won't involve potentially

dozens of blank layouts in order for the Layout number to match the layout name?

Is there a better way to use field inputs to choose a layout?

Please Help. I am totally stuck!

Yes, there is a better way.

Your earlier explanation led me to thinking that you already had a layout for each number combination, and that you were in fact referring to layouts by their number rather than their name. This is obviously not the case.

Given that the Stage and Batch fields are producing numbers which are part of the layout name rather than of the layout number, you will need a more sophisticated formula for the calculating field I suggested, to determine the layout number from an imputed layout name based on stage and batch. The formula I suggest you use is:

PatternCount(Middle(LayoutNames(Status(CurrentFileName)), 1, Position(LayoutNames(Status(CurrentFileName)), "layout " & Stage & Batch, 1, 1)), "

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.