Prohibit editing records when already being edited 
Author Message
 Prohibit editing records when already being edited

Hi all,

I believe the standard CW behavior for handling multi-user record updates,
is to compare a pre-edit snapshot of the record buffer, to the current disk
image of the record (i.e., re-read and compare), and notify the current user
if someone or something else has made changes since your own edit session.

Is there a clear-cut way to prohibit record edits, if it is already being
edit by another user?  Something like, checking the record-lock condition
before allowing a user to enter the form.  If locked by another user, then
notify the current user attempting to edit "Record locked by another user".
I've seen cases where a user has had to edit a record several times, before
getting one to update (because the was a commonly updated record, by many
users).

Is there a CW option to set for this, or perhaps a 3rd party template?  I
really don't want to code the logic in every browse/form combination, no
matter how simple the code is.

Thanks for any ideas/feed-back.

John Farmer



Thu, 18 Mar 2004 12:39:45 GMT  
 Prohibit editing records when already being edited
no template I know of.
you would have to use hold() instead of watch() in updateviewrecord() oin
the abc classes and do the error handler coding.
The downside and the reason why I dont do this is if some one opens a form
for edit and goes away from the computer, it may be locked for a very long
time. Watch is better IMO.
Jim kane


Quote:
> Hi all,

> I believe the standard CW behavior for handling multi-user record updates,
> is to compare a pre-edit snapshot of the record buffer, to the current
disk
> image of the record (i.e., re-read and compare), and notify the current
user
> if someone or something else has made changes since your own edit session.

> Is there a clear-cut way to prohibit record edits, if it is already being
> edit by another user?  Something like, checking the record-lock condition
> before allowing a user to enter the form.  If locked by another user, then
> notify the current user attempting to edit "Record locked by another
user".
> I've seen cases where a user has had to edit a record several times,
before
> getting one to update (because the was a commonly updated record, by many
> users).

> Is there a CW option to set for this, or perhaps a 3rd party template?  I
> really don't want to code the logic in every browse/form combination, no
> matter how simple the code is.

> Thanks for any ideas/feed-back.

> John Farmer



Thu, 18 Mar 2004 13:19:34 GMT  
 Prohibit editing records when already being edited

I am writing an app that does exactly that right now. What I am doing is: When a user attempts to open a file for editing, the app checks a .cfg file on the server, if the file-flag for that file is "0" then the app opens the file for editing. If the file-flag for that file is "1", then the app displays a message saying: "Another user is in the process of editing that file and please try again in a few minutes" then returns to the file browse window! So far it seems to work great!

Quote:

>Hi all,

>I believe the standard CW behavior for handling multi-user record updates,
>is to compare a pre-edit snapshot of the record buffer, to the current disk
>image of the record (i.e., re-read and compare), and notify the current user
>if someone or something else has made changes since your own edit session.

>Is there a clear-cut way to prohibit record edits, if it is already being
>edit by another user?  Something like, checking the record-lock condition
>before allowing a user to enter the form.  If locked by another user, then
>notify the current user attempting to edit "Record locked by another user".
>I've seen cases where a user has had to edit a record several times, before
>getting one to update (because the was a commonly updated record, by many
>users).

>Is there a CW option to set for this, or perhaps a 3rd party template?  I
>really don't want to code the logic in every browse/form combination, no
>matter how simple the code is.

>Thanks for any ideas/feed-back.

>John Farmer



Thu, 18 Mar 2004 18:44:18 GMT  
 Prohibit editing records when already being edited

I am writing an app that does exactly that right now. What I am doing is: When a user attempts to open a file for editing, the app checks a .cfg file on the server, if the file-flag for that file is "0" then the app opens the file for editing. If the file-flag for that file is "1", then the app displays a message saying: "Another user is in the process of editing that file and please try again in a few minutes" then returns to the file browse window! So far it seems to work great!

Quote:

>Hi all,

>I believe the standard CW behavior for handling multi-user record updates,
>is to compare a pre-edit snapshot of the record buffer, to the current disk
>image of the record (i.e., re-read and compare), and notify the current user
>if someone or something else has made changes since your own edit session.

>Is there a clear-cut way to prohibit record edits, if it is already being
>edit by another user?  Something like, checking the record-lock condition
>before allowing a user to enter the form.  If locked by another user, then
>notify the current user attempting to edit "Record locked by another user".
>I've seen cases where a user has had to edit a record several times, before
>getting one to update (because the was a commonly updated record, by many
>users).

>Is there a CW option to set for this, or perhaps a 3rd party template?  I
>really don't want to code the logic in every browse/form combination, no
>matter how simple the code is.

>Thanks for any ideas/feed-back.

>John Farmer



Thu, 18 Mar 2004 18:47:57 GMT  
 Prohibit editing records when already being edited
Just what Jim Kane said ...

I've been in offices where the software worked the way you said .. only one
person could have the edit window open on an account at a time .. and it was
a nightmare.

If you do it, you want the software to report exactly who it is that is
modifying the record.  That will require a database file like a lock table.
Put the person's phone extension in there too.  Also, you want to provide
pens and pads to every worker so they can make note of the changes they
wanted to make while someone else was in the record.

The other thing I've found is this ... if various folks are constantly
updating different pieces of information in the same record, you might want
to consider moving the data into different records.  For an overly simple
example ...

Delivery driver updates the database because the driving directions have
changed somewhat (road number has been changed, street name has been
changed, etc.)

Then, accounts receivable posts a payment to the account.

You should consider having an address record and an accounts receivable
record that are independent of each other.

--

- Andrew Guidroz II (GeeTroze)


Quote:
> Hi all,

> I believe the standard CW behavior for handling multi-user record updates,
> is to compare a pre-edit snapshot of the record buffer, to the current
disk
> image of the record (i.e., re-read and compare), and notify the current
user
> if someone or something else has made changes since your own edit session.

> Is there a clear-cut way to prohibit record edits, if it is already being
> edit by another user?  Something like, checking the record-lock condition
> before allowing a user to enter the form.  If locked by another user, then
> notify the current user attempting to edit "Record locked by another
user".
> I've seen cases where a user has had to edit a record several times,
before
> getting one to update (because the was a commonly updated record, by many
> users).

> Is there a CW option to set for this, or perhaps a 3rd party template?  I
> really don't want to code the logic in every browse/form combination, no
> matter how simple the code is.

> Thanks for any ideas/feed-back.

> John Farmer



Thu, 18 Mar 2004 20:33:13 GMT  
 Prohibit editing records when already being edited

What happens when two users try to edit the same record at
the same time? Does the one who save there record first get
there data wiped out?


Quote:
>Just what Jim Kane said ...

>I've been in offices where the software worked the way you said .. only one
>person could have the edit window open on an account at a time .. and it was
>a nightmare.

>If you do it, you want the software to report exactly who it is that is
>modifying the record.  That will require a database file like a lock table.
>Put the person's phone extension in there too.  Also, you want to provide
>pens and pads to every worker so they can make note of the changes they
>wanted to make while someone else was in the record.

>The other thing I've found is this ... if various folks are constantly
>updating different pieces of information in the same record, you might want
>to consider moving the data into different records.  For an overly simple
>example ...

>Delivery driver updates the database because the driving directions have
>changed somewhat (road number has been changed, street name has been
>changed, etc.)

>Then, accounts receivable posts a payment to the account.

>You should consider having an address record and an accounts receivable
>record that are independent of each other.

>--

>- Andrew Guidroz II (GeeTroze)



>> Hi all,

>> I believe the standard CW behavior for handling multi-user record updates,
>> is to compare a pre-edit snapshot of the record buffer, to the current
>disk
>> image of the record (i.e., re-read and compare), and notify the current
>user
>> if someone or something else has made changes since your own edit session.

>> Is there a clear-cut way to prohibit record edits, if it is already being
>> edit by another user?  Something like, checking the record-lock condition
>> before allowing a user to enter the form.  If locked by another user, then
>> notify the current user attempting to edit "Record locked by another
>user".
>> I've seen cases where a user has had to edit a record several times,
>before
>> getting one to update (because the was a commonly updated record, by many
>> users).

>> Is there a CW option to set for this, or perhaps a 3rd party template?  I
>> really don't want to code the logic in every browse/form combination, no
>> matter how simple the code is.

>> Thanks for any ideas/feed-back.

>> John Farmer



Fri, 19 Mar 2004 09:12:43 GMT  
 Prohibit editing records when already being edited
Hi James,

In fact, the answer is yes.

If the first guy went in and start amending the record, changing all the
data... And while he is doing so, another guy came in to take a look.  While
the second guy is just simply looking, the first guy press SAVE to save the
amendments.  After that, the second press SAVE after looking at the records.

What will happen?  Well... the record will stay as if no amendment was being
done.

What I did was to include a field 'CurrentlyEdited' with a 'BYTE' data type.
At the update form, if tyhe LocalRequest is either 'InsertRecord' or
'ChangeRecord', I will lock record by putting the value in 'CurrentlyEdited'
to be True.  So... in such case that the user were to try to edit while
someone is editing, it will basically put him to View Only mode;  no saving
of data after viewing.  And as for the person who is editing the record, a
False will be put in the 'CurrentlyEdited' after he left the record.  But
always allow the 'Administrator' to be able to edit the 'CurrentlyEdited',
just in case some guys just edit a record and switch off their stations, no
realizing that they had locked the record for editing.

Thanks.

--
Kelvin Chua
SINGAPORE
www.accpro.com.sg
www.aap-online.com/asp - Our e-Shop - Beta
www.accpro.com.sg/clarion - Links to the Clarion World!


Quote:

> What happens when two users try to edit the same record at
> the same time? Does the one who save there record first get
> there data wiped out?


> >Just what Jim Kane said ...

> >I've been in offices where the software worked the way you said .. only
one
> >person could have the edit window open on an account at a time .. and it
was
> >a nightmare.

> >If you do it, you want the software to report exactly who it is that is
> >modifying the record.  That will require a database file like a lock
table.
> >Put the person's phone extension in there too.  Also, you want to provide
> >pens and pads to every worker so they can make note of the changes they
> >wanted to make while someone else was in the record.

> >The other thing I've found is this ... if various folks are constantly
> >updating different pieces of information in the same record, you might
want
> >to consider moving the data into different records.  For an overly simple
> >example ...

> >Delivery driver updates the database because the driving directions have
> >changed somewhat (road number has been changed, street name has been
> >changed, etc.)

> >Then, accounts receivable posts a payment to the account.

> >You should consider having an address record and an accounts receivable
> >record that are independent of each other.

> >--

> >- Andrew Guidroz II (GeeTroze)



> >> Hi all,

> >> I believe the standard CW behavior for handling multi-user record
updates,
> >> is to compare a pre-edit snapshot of the record buffer, to the current
> >disk
> >> image of the record (i.e., re-read and compare), and notify the current
> >user
> >> if someone or something else has made changes since your own edit
session.

> >> Is there a clear-cut way to prohibit record edits, if it is already
being
> >> edit by another user?  Something like, checking the record-lock
condition
> >> before allowing a user to enter the form.  If locked by another user,
then
> >> notify the current user attempting to edit "Record locked by another
> >user".
> >> I've seen cases where a user has had to edit a record several times,
> >before
> >> getting one to update (because the was a commonly updated record, by
many
> >> users).

> >> Is there a CW option to set for this, or perhaps a 3rd party template?
I
> >> really don't want to code the logic in every browse/form combination,
no
> >> matter how simple the code is.

> >> Thanks for any ideas/feed-back.

> >> John Farmer



Sat, 20 Mar 2004 01:18:35 GMT  
 Prohibit editing records when already being edited
No - look at Watch() in the help.
After the 1st person updates, the driver remembers that and the 2nd person
gets a 'Record changed by another station' error but the 1st persons data
will not be over written.  The 2nd person looses their edits - the data
saved by the 1st person is loaded so the second person can see it and change
further if needed.
Jim kane


Quote:

> What happens when two users try to edit the same record at
> the same time? Does the one who save there record first get
> there data wiped out?


> >Just what Jim Kane said ...

> >I've been in offices where the software worked the way you said .. only
one
> >person could have the edit window open on an account at a time .. and it
was
> >a nightmare.

> >If you do it, you want the software to report exactly who it is that is
> >modifying the record.  That will require a database file like a lock
table.
> >Put the person's phone extension in there too.  Also, you want to provide
> >pens and pads to every worker so they can make note of the changes they
> >wanted to make while someone else was in the record.

> >The other thing I've found is this ... if various folks are constantly
> >updating different pieces of information in the same record, you might
want
> >to consider moving the data into different records.  For an overly simple
> >example ...

> >Delivery driver updates the database because the driving directions have
> >changed somewhat (road number has been changed, street name has been
> >changed, etc.)

> >Then, accounts receivable posts a payment to the account.

> >You should consider having an address record and an accounts receivable
> >record that are independent of each other.

> >--

> >- Andrew Guidroz II (GeeTroze)



> >> Hi all,

> >> I believe the standard CW behavior for handling multi-user record
updates,
> >> is to compare a pre-edit snapshot of the record buffer, to the current
> >disk
> >> image of the record (i.e., re-read and compare), and notify the current
> >user
> >> if someone or something else has made changes since your own edit
session.

> >> Is there a clear-cut way to prohibit record edits, if it is already
being
> >> edit by another user?  Something like, checking the record-lock
condition
> >> before allowing a user to enter the form.  If locked by another user,
then
> >> notify the current user attempting to edit "Record locked by another
> >user".
> >> I've seen cases where a user has had to edit a record several times,
> >before
> >> getting one to update (because the was a commonly updated record, by
many
> >> users).

> >> Is there a CW option to set for this, or perhaps a 3rd party template?
I
> >> really don't want to code the logic in every browse/form combination,
no
> >> matter how simple the code is.

> >> Thanks for any ideas/feed-back.

> >> John Farmer



Fri, 19 Mar 2004 11:37:31 GMT  
 Prohibit editing records when already being edited
Hi Jim,

Quote:

> No - look at Watch() in the help.
> After the 1st person updates, the driver remembers that and the 2nd person
> gets a 'Record changed by another station' error but the 1st persons data
> will not be over written.  The 2nd person looses their edits - the data
> saved by the 1st person is loaded so the second person can see it and change
> further if needed.

The way I read the help is not that WATCH remembers if anyone updates the
record.  WATCH remembers the original contents of the record (as read in the
last valid get/next/previous/reget) for the current user, and at a PUT
presumable does a re-read of the record. If the record content as re-read from
the file  is different from the record contents as remembered by  WATCH, the
error 89 will be raised (and the record buffer will contain the current record
contents in the file).

HTH

Arie Rens (RADventure B.V.)
Maarssen, the Netherlands
http://www.radventure.nl
SoftVelocity Distributor for the Benelux



Fri, 19 Mar 2004 14:03:28 GMT  
 Prohibit editing records when already being edited


Quote:
>Is there a clear-cut way to prohibit record edits, if it is already
>being edit by another user?

I have solved this problem by puting a Lock-field in the start of
the record. Whenever anybody wants to edit the record I set it to
none zero when the save the record the lock is set to equal 0.

To avoid dead records because of system.crashes. I have also added
a current active user register. If the number in the lock field is
not amoung the active user, the lock-field is reset and the user can
edit the record.

Kjetil Nesheim
More Computers



Sat, 20 Mar 2004 03:36:57 GMT  
 Prohibit editing records when already being edited

 Well it seems that this is a very lengthy topic with a lot of knowledgable people. This I am thankful for, the way that I am doing it is probably not the best or "right" way, but at least for now and for this client it is working very well. But I am always looking for new and better ways and will for sure try out the idea's that have been posted as to this subject. I have received a lot of very helpful and useful information on this board and look farward to the day, when I might be able to return some of the favors. Thanks to all!!!


Quote:
>Hi Jim,


>> No - look at Watch() in the help.
>> After the 1st person updates, the driver remembers that and the 2nd person
>> gets a 'Record changed by another station' error but the 1st persons data
>> will not be over written.  The 2nd person looses their edits - the data
>> saved by the 1st person is loaded so the second person can see it and change
>> further if needed.

>The way I read the help is not that WATCH remembers if anyone updates the
>record.  WATCH remembers the original contents of the record (as read in the
>last valid get/next/previous/reget) for the current user, and at a PUT
>presumable does a re-read of the record. If the record content as re-read from
>the file  is different from the record contents as remembered by  WATCH, the
>error 89 will be raised (and the record buffer will contain the current record
>contents in the file).

>HTH

>Arie Rens (RADventure B.V.)
>Maarssen, the Netherlands
>http://www.radventure.nl
>SoftVelocity Distributor for the Benelux



Sat, 20 Mar 2004 05:05:51 GMT  
 Prohibit editing records when already being edited
Arie
I dont think so. If you look in abfile.clw in the update code you'll see the
reload is explicitly done by the abc class.
Jim Kane



Quote:
> Hi Jim,


> > No - look at Watch() in the help.
> > After the 1st person updates, the driver remembers that and the 2nd
person
> > gets a 'Record changed by another station' error but the 1st persons
data
> > will not be over written.  The 2nd person looses their edits - the data
> > saved by the 1st person is loaded so the second person can see it and
change
> > further if needed.

> The way I read the help is not that WATCH remembers if anyone updates the
> record.  WATCH remembers the original contents of the record (as read in
the
> last valid get/next/previous/reget) for the current user, and at a PUT
> presumable does a re-read of the record. If the record content as re-read
from
> the file  is different from the record contents as remembered by  WATCH,
the
> error 89 will be raised (and the record buffer will contain the current
record
> contents in the file).

> HTH

> Arie Rens (RADventure B.V.)
> Maarssen, the Netherlands
> http://www.radventure.nl
> SoftVelocity Distributor for the Benelux



Sat, 20 Mar 2004 07:47:50 GMT  
 Prohibit editing records when already being edited
James,

Okay, except, I don't want to lock out the whole file, just the record I'm
editing.

John


Quote:

> I am writing an app that does exactly that right now. What I am doing is:

When a user attempts to open a file for editing, the app checks a .cfg file
on the server, if the file-flag for that file is "0" then the app opens the
file for editing. If the file-flag for that file is "1", then the app
displays a message saying: "Another user is in the process of editing that
file and please try again in a few minutes" then returns to the file browse
window! So far it seems to work great!
Quote:


> >Hi all,

> >I believe the standard CW behavior for handling multi-user record
updates,
> >is to compare a pre-edit snapshot of the record buffer, to the current
disk
> >image of the record (i.e., re-read and compare), and notify the current
user
> >if someone or something else has made changes since your own edit
session.

> >Is there a clear-cut way to prohibit record edits, if it is already being
> >edit by another user?  Something like, checking the record-lock condition
> >before allowing a user to enter the form.  If locked by another user,
then
> >notify the current user attempting to edit "Record locked by another
user".
> >I've seen cases where a user has had to edit a record several times,
before
> >getting one to update (because the was a commonly updated record, by many
> >users).

> >Is there a CW option to set for this, or perhaps a 3rd party template?  I
> >really don't want to code the logic in every browse/form combination, no
> >matter how simple the code is.

> >Thanks for any ideas/feed-back.

> >John Farmer



Sat, 20 Mar 2004 10:21:25 GMT  
 Prohibit editing records when already being edited
Jim,

I see your point... Like when the boss finally gets logged into his new 2ghz
mega $ computer (the one he uses to read e-mail), then looks up a record in
your CW application, then decides to go play golf, without logging out of
his session, of course.  Yes, that would be a pain.  Thanks to all for their
input.

John Farmer


Quote:
> no template I know of.
> you would have to use hold() instead of watch() in updateviewrecord() oin
> the abc classes and do the error handler coding.
> The downside and the reason why I dont do this is if some one opens a form
> for edit and goes away from the computer, it may be locked for a very long
> time. Watch is better IMO.
> Jim kane



> > Hi all,

> > I believe the standard CW behavior for handling multi-user record
updates,
> > is to compare a pre-edit snapshot of the record buffer, to the current
> disk
> > image of the record (i.e., re-read and compare), and notify the current
> user
> > if someone or something else has made changes since your own edit
session.

> > Is there a clear-cut way to prohibit record edits, if it is already
being
> > edit by another user?  Something like, checking the record-lock
condition
> > before allowing a user to enter the form.  If locked by another user,
then
> > notify the current user attempting to edit "Record locked by another
> user".
> > I've seen cases where a user has had to edit a record several times,
> before
> > getting one to update (because the was a commonly updated record, by
many
> > users).

> > Is there a CW option to set for this, or perhaps a 3rd party template?
I
> > really don't want to code the logic in every browse/form combination, no
> > matter how simple the code is.

> > Thanks for any ideas/feed-back.

> > John Farmer



Sat, 20 Mar 2004 10:26:48 GMT  
 Prohibit editing records when already being edited
Jim,

Quote:
> I dont think so. If you look in abfile.clw in the update code you'll see the
> reload is explicitly done by the abc class.

I stand corrected, the record re-read from disk by the watch/put does not
replace the record buffer contents.

Arie Rens (RADventure B.V.)
Maarssen, the Netherlands
http://www.radventure.nl
SoftVelocity Distributor for the Benelux



Sat, 20 Mar 2004 15:15:23 GMT  
 
 [ 15 post ] 

 Relevant Pages 

1. Editing part of a record in InLine Editing

2. Edit drop list Edit in place - problem

3. Can not edit my program, I know about edit mode

4. Real Editing w/ E edit descriptor question

5. Am I in VIEW or EDIT?

6. Editing a database record from a listbox

7. Problem with browse window - loss of current record after edit

8. C5 Record validation in edit-in-place mode

9. CW2.003: How to edit/print single instance records

10. Get record during edit (how?)

11. What can I use to edit records in a Topspeed file, ignoring Ref-Integrity

12. prob: editing/adding mult records on screen

 

 
Powered by phpBB® Forum Software