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

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

Recommended Posts

Posted

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.

Posted

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

Posted

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

Posted

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

Posted

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

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