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

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

Recommended Posts

Posted

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

Posted

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

This topic is 7308 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.