Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Karben Selim Mejia
  Where is Karben Selim Mejia?
 San Pedro Sula
 Honduras
 Karben Selim Mejia
 To: John Discallar
  Where is John Discallar?
 Nagoya
 Japan
 John Discallar
 Tags
Subject: RE: Unique reference number under multi-user wo...
Thread ID: 22134 Message ID: 22155 # Views: 25 # Ratings: 0
Version: Visual FoxPro 6 Category: General VFP Topics
Date: Thursday, April 10, 2003 3:52:00 PM         
   


> > I have an accounting application, where the Debit Note/Credit Note/Invoice numbers are taken from a table. When the user starts makeing the Debit Note a reference number from the the table lastno.dbf is alloted as Debit Note number and when he saves the Debit Note lasno.dbf field is incremented by 1. This works fine only when one user is working in the system. Now a situation has come where more than one users have to work simultaneously. There is a time gap of minimum 2 minutes for taking a new number and saving the documents - if the user gets a phone call in between, cannot say when he will save the document. During this time, if another user try to make a debit note he also makes a debit note with the same reference number.
> >
> > There are a lot of experienced foxite members who develop applications for multiuser environment. Could somebody explain how such situation is handled perfectly.
> >
> > Thanks for help.
> >
> > Benny
>
> What you could do is just assign the debit number "after" the user saves the data , in this manner , you will be sure that
> redudancy will not happen.
>
> Foxpro Child

IMHO this is the only way to do so, getting the number at the moment of saving the data, do not forget to lock the record when doing so though

Karben Selim Mejia

Life is a bad teacher, It puts you the test first, then teaches you the leasson.
Honduras, Central America
The very centre of the world

COMPLETE THREAD

Unique reference number under multi-user working Posted by Benny Thomas @ 4/10/2003 9:05:26 AM
RE: Unique reference number under multi-user wo... Posted by Caij Gomez @ 4/10/2003 9:17:00 AM
RE: Unique reference number under multi-user wo... Posted by Sazabi Ho @ 4/10/2003 10:30:49 AM
RE: Unique reference number under multi-user wo... Posted by Karben Selim Mejia @ 4/10/2003 3:52:00 PM
RE: Unique reference number under multi-user wo... Posted by Pete Sass @ 4/11/2003 2:25:52 AM
Great! but how to handle "Cancel" Posted by Ellick Yeung @ 4/12/2003 5:59:29 AM
RE: Great! but how to handle "Cancel" Posted by Pete Sass @ 4/13/2003 5:48:11 AM
Thanks! Got it. Posted by Ellick Yeung @ 4/14/2003 9:53:02 AM