Solved

Automatic Numbering - HELP!

Posted on 2001-06-18
3
171 Views
Last Modified: 2013-12-18
I have inherited a database created by someone else.  It has a reference number comprising of letters and sequential numbers.

When the user creates a new document, they are prompted on queryopen to select the document type (and therefore the letters to be used to prefix the number), this is then used to look up the next available number for that prefix (on a separate document), which is used for the reference number.  The number returned is then incremented by one and written back to the number document.

Obviously there are problems applying the number at queryopen (ie even if the document is not saved, the number still increments), however the user is experiencing erratic numbering far beyond the extent you would expect with creating and not saving documents.  Numbers are working sequentially, then suddenly jumping anything from 2 up to 60!  Does anyone have any ideas, because I've tried everything I can think of.

Deb
0
Comment
Question by:gingerdeb
[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 Comments
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 6204749
You have to take a close look at the database.

Check for any hidden views or profile documents where the counter might be increased irrespective of the doc save.

As you said that the counter is generated in the queryopen, it would be appropriate if the counter is increased before save i.e in QuerySave.


If you want me to take a look at the database, you are most welcome.

Here is my Email hemanthakumark@bigfoot.com

PS: Compress the database and send it to me.

~Hemanth
0
 
LVL 6

Accepted Solution

by:
ghassan99 earned 200 total points
ID: 6205872
I had this problem before, here is how I tackled it:
I check for the last number in the view of numbers (in queryopen), retrieve it, add one to it, then show it to the user.  NOTE: I'm not adding this number to the view of numbers, or creating a doc for the new number.  When the user is ready to the save, I check this number in the querysave event to see if its still the next number in the number's view.  If it is, then I create a document and add it to the number's view.  If not, I will check what the next number is, then alert the user to the number change, and create a new document in the numbers view.  This way is 98% bullet proof (according to my OWN benchmark:).  There is no way that u will achieve 100% accuracy.
You can also check this Faq for extra info:
http://www.keysolutions.com/NotesFAQ/howdo.html

-Gus
0
 
LVL 2

Author Comment

by:gingerdeb
ID: 6240397
I'm accepting Gus' answer because it had some useful tips in it for future reference, although it didn't actually solve this particular problem.  Personally, I'm thinking user-error/ignorance is the cause of the large gaps in numbering.  The user is claiming numbers are missing, but I've been able to show her the documents with the missing numbers in another view - for some reason, she's still not convinced!  As for some of the minor gaps - I'm still not sure as the numbering was initially done via a script when old documents were imported into the database!  Anyway, there doesn't seem to be a problem any longer.

Thanks,

Deb
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Suggested Solutions

For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
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…

763 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