Jump 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.

Featured Replies

  • Newbies

Hello,

We have a simple Filemaker solution which tracks stock we order from suppliers (Item ID (unique Key), Description, Category, Invoice, Serial Number, Date, etc) which we used to track stock and print labels from. (Table: Stock Items)

I would like to make an improvement to this by adding a stock take functionality. As we barcode the items and print the Item ID I would like someone to be able to walk around the shop and scan each barcode and then we can generate reports from there. The barcode scanner is setup to add a carriage return at the end of the scan to move on to the next line.

I have setup a table called "Stocktake". We just want to enter the Item ID and then other fields can be looked up. (see attached screenshot).

The issue I have is that I struggle for FM to create new records. What I have setup is created a script which makes a new record, and sets the focus to the field Stocktake:Item_id

- New Record/Request
- Go to Field [Stocktake::Item_ID]

I have then added a trigger to the Item_ID field which on "OnObjectSave" runs this script.

I have two problems:

1. If I type in a stocknumber the record is entered into the table, the script runs (can check it using tools), a new record is created but when the script finishes the focus is not on the Item_ID field. In fact there is no field that has focus applied. However, if I manually click on "New Record", or manually run the script the focus is on the field Item_ID for entry for the next item.

2. I notice that the record only is recorded if I press "Enter" on my numeric keypad. If I press "Enter" on the main keyboard it will not save the record. I am aware that on a Mac these keys are treated differently. What do I need to configure here? The scanner we use for barcodes has been configured to add a carriage return but this appears to be the same one as the main enter key and does not enter records.

I must just be doing something simple wrong. If anyone could give me some guidance it would be greatly appreciated.


Platform is Filemaker 12 Advanced running on Windows.

Capture.JPG

If you format the field to 'Go to next object using [x] Return [x] Enter' (under Inspector > Data > Behavior), then either Enter or Return will exit the field - allowing you to use OnObjectExit as the script trigger.

Alternatively (and IMHO preferably), you could use a looping script showing the field in a custom dialog. Both Enter and Return select the first (default) button.

  • Author
  • Newbies

Thanks for your quick response!

Your suggestion of moving to next object by enabling "Return" under the inspector worked.

However, if I run the script using OnObjectExit as the trigger it went into a never ending loop just creating records. Not sure why?

Doing some more research, I found that adding:

Exit Script [Result: False]

to my original script fixed it. There is an explanation at http://forums.filemaker.com/posts/87c74253ef which states:

Is this within a script performed by a script trigger? If so, that could explain it. The Exit Script [False] step cancels the pending event that fired the script trigger and might be an event that would otherwise put the cursor in a different location as it takes place after Go To Field.

You can look up "setting up script triggers" in FileMaker help to see a table of all triggers and which perform scripts before the triggering event and which perform them after the triggering event.

although how this relates to my script / layout I'm not entirely sure?

Best regards, JS

Keep in mind that an OnObjectExit trigger runs the script before executing the triggering event.

Create an account or sign in to comment

Important Information

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

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.