Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 7128 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Could someone give me an explanation of how to use GetNextSerialValue()

Whatt Im doing is:

I Have a number field which is auto enter serial number

A global number field

a script which is

set field global number GetNextSerialValue ( Get ( FileName ); test_table::serial number)

what am i doing wrong or what is supposed to happen when i run this script

Thanks Stu

Posted

This process should return the next serial number in line to the global field.

Let me outline the criteria for this to work as intended in my example to follow:

Table Name = "TestTable"

Global field name = "gNextSerial" (Options = Storage: Global Field)

Number filed name = "SerialNbrID" (Options= AutoEnter: Serial Number)

In a script use the following:

SetField [TestTable::gNextSerial] , [GetNextSerialValue ( "TestTable" ; "SerialNbrID" )]

Please note that the name of the table and the field used in the GetnextSerialValue function are separated from one another by the semicolon, and their names are in "quotes".

The quotes are necessary so that the filemaker knows if it should treat the table and field names literally.

If you fail to use quotes, FileMaker assumes you are attempting to build the content dynamically and as a result will attempt to refer to the stored content of the two different fields that you named to build the destination.

New Example:

field name: tempdata01 = "TestTable"

field name: tempdata02 = "SerialNbrID"

So using the above two fields you could construct the same statement by ommiting the quotes:

GetNextSerialValue ( tempdata01 ; tempdata02 )

The statement above would evaluate to:

GetNextSerialValue ( "TestTable" ; "SerialNbrID" )

Clear as mud? smile.gif

This topic is 7128 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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