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.

GetNextSerialValue - always returns null

Featured Replies

I may be going about this all wrong, but...

I'm loading an Invoices DB with an Applescript. The AS creates one entire Invoices record (as a list), and then writes it to the DB with the following statement:

create new record at end with data myFMPRecordList

Invoices DB contains an Invoices_ID field. I want FM to calculate it for me, so I defined Invoices_ID as an auto-enter serial value. 'myFMPRecordList' contains a null string ("") item as the value for the Invoices_ID field. After the 'create new record', my AS invokes an FM script to calculate Invoices_ID.

The script is basically just

SetField[invoices_ID, GetNextSerialValue(Status(CurrentFileName), Invoices_ID)

However, all that ever gets returned by GetNextSerialValue (and stored in Invoices_ID) is null. When I check the field definition, I see that the serial number has been properly incremented.

Any idea why this is happening? And, is there a more direct way to do this?

Thanks,

Chap

Does this only happen when you call the FM script from your Applescript, or does it happen when you run the FM script manually?

  • Author

It happens when I run the FM script manually, too.

  • Author

I've posted a simple example, NextSerial.fp5. It contains a text field called ID that is defined to auto-enter a serial number.

After opening NextSerial.fp5, click "Create New Record". Then click "Get Next Serial No.". It will temporarily store "Ready?" into gNextSerialNumber to demonstrate that gNextSerialNumber is being set and displayed.

Click Continue and the script will set gNextSerialNumber to GetNextSerialNumber(Status(CurrentFileName), ID), and you'll see it's null.

NextSerial.fp5.zip

Add quotes around your ID field in the script.

  • Author

Thanks!

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.