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.

GetNextSerialValue not working

Featured Replies

I am trying to use a single serial number sequence for two things. When I create a new record, I want a Dec_id number to auto enter the same number as an auto enter serial field (job number). No problem. Then, I want to be able to set the next serial value from that sequence in a third field. I have tried every way I can think of with the "GetNextSerialValue" function I can think of with no success. I suspect I have my syntax wrong, but have not had any luck finding my mistake.

test.fp7.zip

Edited by Guest

I have no idea what this is good for, but you are right to suspect your syntax. If you care to read the help for GetNextSerialValue(), you will see that both parameters must be enclosed in quotes. See also the paragraph marked "Important" here:

http://www.filemaker.com/help/Functions%20Ref26.html

Thanks comment: "quotes" around fieldname ! Was my problem too a while ago. Scriptmaker does not complain, to bad !

Just some more additional observation:

1. test seams not a good filename for a Filemaker file. I unzipped it in my downloadfolder it translated to test.4.fp7 because I had a number of other filenames (3) starting with "test" ! ( starting only !!!!).

So the hard coded filename "test" from the sample file would have not worked any way.

2. Beside the quotes I changed the hard coded “test” in the script steps to Get(FileName) ( which gives the right “test.4”) but the sample script did not work !

Looks like GetNextSerialValue ( Get(FileName);”FieldName”) works only if the FileName does not include any “.4” ( any dot number )

FileNames with dot text e.g. test.front.fp7 work fine.

Just checked hard coded filenames “test.4” ( any dot number ) also does not work.

May be that’s also some where hidden as an information in the help files :)?

"quotes" around fieldname ! Was my problem too a while ago. Scriptmaker does not complain, to bad !

It doesn't complain, because it is valid syntax, too - IF the actual field name is stored in the referenced field. IOW, it works similar to GetField().

“test.4” ( any dot number ) also does not work.

It's not good practice to have file names with periods in them (other than the one preceding the extension). I believe this issue was discussed at some time, and IIRC the solution is:

GetNextSerialValue ( Get(FileName) & ".fp7" ; "SerialID" )

  • Author

Thanks Comment. I read the help for the function itself over and over, but never made the step back to read the help on design functions themselves.

The table I am working with is for order input / job creation. As part of the process, a related record is created in another table (Decorations). This contains the decoration instructions for the products on the order. Most ooccasions, there is only one Decoration ID for an order, so using the job number as the key is convenient and identifies the first order that the set of decorations was used on (handy at reorder time) However, there are times when there are more than one decoration Id needs to be created for a single job number (far less often). When this happens, the decoration id needs to be assured of being unique. It is no problem to do it manually with scripting (how I’ve been doing it), but this new way seemed more elegant.

Get(FileName) & ".fp7"

Yes comment thanks. Now I recall ;-)

  • 1 month later...

It almost appears that the "GetNextSerialValue" function is actually a Plug-In.

I have just found an exception to the "both values enclosed in quotes" statement. ( I'm a newby)

If you are storing your file name in a field as I do the following works....

GetNextSerialValue (Globals::Current Program Version Global ; "Builder List::Builder ID" )

If the field name is enclosed in quotes the function produces nothing.

I know what you're thinking but I have my reasons.

Well, if you know what I'm thinking, I guess there's no point in me saying it, is there?

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.