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.

Incrementing a non specified field.

Featured Replies

I am creating a database for our production line. One of the features that I need to implement is the capability of the operator to click in a field and hit an increase or decrease button. I have about 100 fields right now that the operator can enter numeric information. How do I get the script to recognize the "chosen" box at the time they hit the increase or decrease button?

Thank you in advance.

Well, I can think of two ways to do this. One is very complex but can be done with straight FileMaker. The other is much simpler, but needs AppleScript.

Here's the script given only FileMaker:

code:


If [ Status( CurrentFieldName ) = "Field1" ]

Well, I can think of two ways to do this. One is very complex but can be done with straight FileMaker. The other is much simpler, but needs AppleScript.

Here's the script given only FileMaker:

code:


If [ Status( CurrentFieldName ) = "Field1" ]

  • Author

quote:

Originally posted by Chuck:

Well, I can think of two ways to do this. One is very complex but can be done with straight FileMaker. The other is much simpler, but needs AppleScript.

Here's the script given only FileMaker:

code:
If [ Status( CurrentFieldName ) = "Field1" ]

There shouldn't be any problem as far as reports go. The two methods do the exact same thing. AppleScript is able to do it with much less code because AppleScript can set the contents of a field when the name of the field is held in another field. FileMaker alone can't do this.

Chuck

  • Author

quote:

Originally posted by Chuck:

There shouldn't be any problem as far as reports go. The two methods do the exact same thing. AppleScript is able to do it with much less code because AppleScript can set the contents of a field when the name of the field is held in another field. FileMaker alone can't do this.

Chuck

Thank you for your response. I am doing something wrong though, when I try to run the AppleScript is keeps telling me "Object could not be found Error -1728" and puts an odd mix of letters in the "gCurrent

This is the AppleScript I have entered for the script:

set ( cell ( cell "gCurrent Field" of layout 2 of database "Prodata Workcenter.fp5" ) ) to ( ( cell ( cell "gCurrent Field" of layout 2 of database "Prodata Workcenter.fp5" ) of layout 2 of current record of database "Prodata Workcenter.fp5" ) + 1 )

Try breaking it up. I put it all in one line, for which I aplogize, but this will do the same thing:

code:


Set Field [ gCurrent_Field, Status( CurrentFieldName ) ]

Perform AppleScript [

set CurrentField to (cell "gCurrent_Field" of layout 0 of database "File.fp5")

set CurrentNumber to (cell CurrentField of layout 0 of current record of database "File.fp5")

set (cell CurrentField of layout 0 of current record of database "File.fp5) to CurrentNumber + 1

]

See if that helps, since you can test each step one at a time to see where the problem might be more accurately.

Chuck

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.