Solved

Order Number problem in Filemaker Pro 12

Posted on 2014-01-21
5
931 Views
Last Modified: 2014-01-23
I have a serial number field i want to use to create an order number. However, even if i exit the record without saving, the number increments. How can I stop this happening and get the Order Number to increment only when I have saved the record? P.S. I am totally new to this, help wpould be much appreciated.
0
Comment
Question by:howardl
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 25

Accepted Solution

by:
Will Loving earned 500 total points
ID: 39798687
The Auto-Enter Serial Number function applies the Serial Number and increments the hidden "Next Serial Value" when you create the record. If you don't save the record, the "Next…" value is still incremented and used the next time you start a record. It doesn't reset backwards because the Serial Number has already been used.

If you want to reset the "Next Serial Value…" value anytime you cancel a record, then you would need to add a "Set Next Serial Value" script step to the Cancel script. The calculation needs to be able to determine the Maximum Serial value currently used and set the serial value to the next one. You can't just set it back to the previous value because another user might have already gone ahead and created a new record, using the "Next" value and incrementing it again.

In other words, while you can try to avoid skipped serial numbers, unless you are and always will be the only user of the file - meaning it's not hosted or setup as a multi-user database you'll only be able to set the serial number to the maximum serial number used. There are ways to avoid skipped order numbers but they are fairly complicated and likely not worth the effort to learn how to do it.

There are a couple of ways to determine the Maximum current serial number and set the appropriate "Next.." value. The main one would be to create a Self-Join relationship between the table and itself using the "cartesian" or "X" relationship option. This relates all records to all other records. I've called the relationship "Orders_SJ" Then you use the Max() function to determine the max value and add one:

Max( Orders_SJ::OrderNumber )
0
 

Author Comment

by:howardl
ID: 39802506
Thank you for you quick response. Unfortunately I have not been able to make this work due to my newbie status. I am accepting your soultion but could you just point me in the right direction to achieve this, e.g. where to place the script?

Thank you Will
0
 
LVL 25

Expert Comment

by:Will Loving
ID: 39803216
Well, the first question is: Do you have a script that cancels the new record? Perhaps a button that either runs a script step or an actual script? Scripts are listed under the Scripts menu. You can determine what is connected to a button by going into Layout Mode and double clicking on it.

As far as making the Self-Join relationship, you go to File -> Manage -> Database. In the relationship diagram you'll see one or more tables. You need to duplicate the existing table, I'm guessing it's called Orders, and name it something like Order_SJ. Then create a relationship between the two Table Occurrences (aka "TO") from the Order Number field in one to the Order Number field in the other. Be sure to select the "X" option rather than "=" in the Edit Relationship dialog. That gives you the relationships you need. Once you have that you can base calculations on it such as the Max() formula I gave you above.
0
 

Author Comment

by:howardl
ID: 39803386
Thank you so much Will.
0
 

Author Closing Comment

by:howardl
ID: 39805260
Really appreciate this
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Filemaker Pro and FM Go Synch 1 265
FIlemaker Go - Drop Down List Window Control 1 589
FM - Problem Printing Color from Filemaker 6 159
Unable to Find records in FileMaker Pro 3 65
Conversion Steps for merging and consolidating separate Filemaker files The following is a step-by-step guide for the process of consolidating two or more FileMaker files (version 7 and later) into a single file with multiple tables. Sometimes th…
Having just upgraded from Filemaker 11 to Filemaker 12 over the weekend, we thought we would add some tips for others making the same move.  In general, our installation went without incident. Please note that this is not a replacement for Chapter 5…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

737 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question