August 15, 201411 yr Hi, I would like to put the next serial increment value into a message box but I get no value when I use …. "Your next value is " & GetNextSerialValue ( Get ( FileName ) ; User::UserID ) I don't want to use it, just reference it in a message box. Since the above function yields no value in a message box, is there another way ? Thank you. Tom
August 15, 201411 yr "Your next value is " & GetNextSerialValue ( Get ( FileName ) ; User::UserID ) You need to pass the field name as a literal expression. Did you read the documentation?
August 16, 201411 yr Author Eos, I read Filemaker's definitions ... Data type returned text Originated in FileMaker Pro 6.0 or earlier Description Field names must be fully qualified in the format tablename::fieldname to specify a field that exists in a table different from the current table. Examples GetNextSerialValue(“Customers”;”CustID”) returns the next serial number for the CustID field.
August 16, 201411 yr Author Eos, So ... I put the field in quotes … :-) Gotcha !! :-) Thank you. Eos, GetNextSerialValue ( Get ( FileName ) ; "User::UserID" ) Works perfectly :-) Again, thank you. Tom
August 16, 201411 yr Why don't you quote the important part: Important Literal text parameters such as filenames and layout names must be enclosed in quotation marks. Use quotation marks around field names to indicate the literal string is the parameter (omit quotation marks to indicate the value stored in the field is the parameter).http://www.filemaker.com/help/13/fmp/en/html/func_ref1.31.34.html#1028995 What this means is that your version: GetNextSerialValue ( Get ( FileName ) ; User::UserID ) looks inside the User::UserID field for the name of the field to get the next serial value from. You need to use either: GetNextSerialValue ( Get ( FileName ) ; "User::UserID" ) or, preferably (to prevent the calculation from breaking if the field is renamed): GetNextSerialValue ( Get ( FileName ) ; GetFieldName ( User::UserID ) )
August 16, 201411 yr Great explanation, Michael. I believe I have some fields mis-specified this same way.
Create an account or sign in to comment