Skip 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 multiple records from range

Featured Replies

Hi all,

I'm struggling a bit with this one...

I have a script which:

Opens up a custom dialog:

"Please enter start reference number"

User enters for example:

"1093345"

This sets global field g_Start to 1093345

Opens up second custom dialog:

"Please enter end reference number"

User enters for example:

"1093446"

This sets global field g_End to 10903446

Now I have my range.

What I need the script to then do is create records in this database, each record has a field - "Reference Number". The script will take the first reference number in the range enter this into the field "Reference Number" and this will be the first record it creates.

It will then continue through the range creating all the records required.

Any ideas on how to do this please?

The concept:

The database above is called CoachTickets.fp5

Users are entering Coach Tickets they have just received in stock - they are ordered in bulk. They may for example contact the coach company and order 100 tickets, these will be delivered and the reference numbers will be sequential.

The tickets are loaded on the database ready to be sold using the range function I'm trying to create above.

Now in a seperate database the user creates a record and the customer this record relates to wants to buy some coach tickets. They enter the number of tickets required e.g. 6. This database then goes off to CoachTickets.fp5, sets the next available 6 tickets to "Sold" and gets the reference numbers and brings them back to the main database. - I'm also after a way to range these 6 tickets if you have any ideas, so if the customer wants six tickets it will go off and get the reference numbers e.g

1000001

1000002

1000003

1000004

1000005

1000006

I want the main db to show:

Tickets selected: 1000001 - 1000006

Any help would be great

Many thanks all

Ed.

Ed,

I know this Range Fashion has hit this forum for a while right now, but why not simply use your "number of tickets" for this job, either when creating records than when selecting them.

You'd need :

1.a global g_ReferenceNumberStart

2. a global g_numberoftickets

3. a g_ReferenceNumber

Then after populating g_numberoftickets and g_ReferenceNumberStart, the script could (for 6 tickets starting N

  • Author

Thanks again Ugo

Just what I needed!

Ed.

Eddy,

just noticed that I've been tedious again...

displayFirstToLastByCustID = Min(::SelfJoin:ReferenceNumber) & "-"& Max(::SelfJoin:ReferenceNumber)

should be (I think) easier than :

displayFirstToLastByCustID = Min(::SelfJoin:ReferenceNumber) & "-"& (Min(::SelfJoin:ReferenceNumber)+ Count(::Selfjoin::ReferenceNumber))

and I definitely think the SelfJoin should be made upon a Order N

  • Author

Of course! This may be a problem.

Not necessarily always numbers, they could contain letters, I haven't actually had the full details as yet.

Ed

Huh...

No clue for your first request as to input the tickets then, as there will be no other option IMO as to rewrite each serial one to one.

For the second request, the LAST function could retrieve the Last serial entered Last(::SelfJoin:ReferenceNumber), but I have no idea how to retrieve the first one, apart with a script and a new text field (FirstTicketN

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

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.