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.

Create an Automated Script to Increment a number by 1

Featured Replies

I am a beginner in Filemaker using Filemaker 18 and I need a script to increment a number by 1.

I have 3 fields.

Start Number

End Number

New Number

I want to enter a number in the start field "50"

I want to enter a number in the end field "100"

I need the script to create a new record each time filling in the "New Number" field starting at 50 and ending with 100

Please dumb down the answer as much as possible because I am not at all familiar with scripting.

Capture.JPG.c165ac2259843a021e4f771be41bdcab.JPG

Thanks in advance for the help

 

 

Can you explain why you need this? It seems like you should have two tables: a parent table where you would enter the start and end values; and a child table where the script would create an individual record for each value between start and end, and relate it to the parent record. Having all three fields in the same table makes very little sense.

 

  • Author

I need to create a unique barcode for each record.

can you give your suggestions as to how to accomplish this.

Please dumb it down as I am new to Filemaker.

I know how to make tables

8 minutes ago, dancer5678 said:

I need to create a unique barcode for each record.

I am afraid that doesn't tell me much. Please explain what do these numbers represent in real life and how do you intend to use them one they are generated. 

 

  • Author

Once generated I will create a barcode field from the gererated number which i can print out. I need to create unique barcodes for products

I am still in the dark regarding your purpose. See if the attached demo can be adapted to your situation.

 

GenerateSeries.fmp12

  • Author

Thanks for helping me with this

Your idea works

But I need each value it creates to be a separate record. Can you assist me with that?

 

Just now, dancer5678 said:

I need each value it creates to be a separate record.

Each value it creates IS a separate record in the Child table.

 

  • Author

Thank you for your help. It looks like it will work. One other question. In filemaker after data is entered is there a way to lock the data so it cant be modified by the user.

For example the data entry department enters the data

But you don't want the sales staff to be able to alter what they entered

  • Author

 I am back to the barcode database question.

I added a field called "Barcode" and a field called "Barcode Calculation"

I need the value that you are creating in the child table record to go into the barcode field so that I can change the Barcode Calculation field to a Barcode font.

 

Right now it is showing up as a 0

I have attached the DB you sent me with my additions. can you tell me what I have to fix to make this work.

 

GenerateSeries.fmp12

IIUC, you want to make the calculation =

"*" & Value & "*"

and set the result type to Text. You don't need two calculation fields for this. In fact, you may not need a calculation field at all - you could simply type:

*<<Value>>*

directly onto the layout.

 

  • Author

Thank you for your assistance with the scripting. It was very helpful

  • Author

How could I modify the value to have a letter after it like "A"

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.