Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Recording Field Changes

0 views
Skip to first unread message

Joey Chandler

unread,
Aug 19, 1997, 3:00:00 AM8/19/97
to

Dear Everyone,

I would like to create a form that automatically records the changes
that a person makes. Things get a little bit more difficult because I
can't simply say that so and so field was modified and the value is now
X. I need to note that Field A changed from X to Y. A few ideas I had:

1. create a duplicate set of fields, compare the new to the old and
note the difference. Very ugly and no one likes maintaining 2 sets of
field.

2. Using Script, record the value of the field when the user enters it,
compare it to the value when the user leaves, and document any changes
in a change history. Works OK, but this would record all the changes to
a single field during an editing session. I would prefer to note the
change only when the document is being saved. The question is how do I
save the original value without having duplicate fields?

3. I started playing with the various GetItem methods in the
DocumentClass. I thought if I could create an array the the Item names
and values when the document is opened and another when the document is
closed I would be able to compare the two and note the changes.
Unfortunately, since I need to use the NotesUIdocument class to access
the current document and that class doesn't have the GetItem methods,
this approach doesn't appear to be do-able.

So basically I need suggestions on several levels: 1. Is there
anything I can do to make my approaches work? 2. Am I missing a tactic
altogether? 3. Has anyone worked on this problem before and if so do
you have any examples that you would be willing to share?

Thank for the help,

Joey Chandler

jfu...@thenetguru.com

unread,
Aug 19, 1997, 3:00:00 AM8/19/97
to joey_c...@zd.com

Joey Chandler wrote:

Dear Everyone,

I would like to create a form that automatically records the changes
that a person makes. Things get a little bit more difficult because I
can't simply say that so and so field was modified and the value is now
X. I need to note that Field A changed from X to Y. A few ideas I ad:


1. create a duplicate set of fields, compare the new to the old and
note the difference. Very ugly and no one likes maintaining 2 sets of
field.

2. Using Script, record the value of the field when the user enters t,

compare it to the value when the user leaves, and document any changes
in a change history. Works OK, but this would record all the changes o

a single field during an editing session. I would prefer to note the
change only when the document is being saved. The question is how do I
save the original value without having duplicate fields?

3. I started playing with the various GetItem methods in the
DocumentClass. I thought if I could create an array the the Item names
and values when the document is opened and another when the document is
closed I would be able to compare the two and note the changes.
Unfortunately, since I need to use the NotesUIdocument class to access
the current document and that class doesn't have the GetItem methods,
this approach doesn't appear to be do-able.

So basically I need suggestions on several levels: 1. Is there
anything I can do to make my approaches work? 2. Am I missing a
tactic
altogether? 3. Has anyone worked on this problem before and if so do
you have any examples that you would be willing to share?

Thank for the help,

Joey Chandler

Joey -

Perhaps you've already thought of this, but thought I'd suggest it
anyway.

Try setting environment variables in script for each field value when
the document is opened. Then upon saving the document, compare the
field values to the environment variables and record your results in the
appropriate DB.

Doing this would give you the functionality of #1 without requiring the
additional fields. In the case of save and replication conflicts, this
would also make change reporting user-centric as opposed to
document-centric.

Cheers - John

Gary McGinn

unread,
Aug 19, 1997, 3:00:00 AM8/19/97
to

Joey Chandler wrote:
> 3. I started playing with the various GetItem methods in the
> DocumentClass. I thought if I could create an array the the Item names
> and values when the document is opened and another when the document is
> closed I would be able to compare the two and note the changes.
> Unfortunately, since I need to use the NotesUIdocument class to access
> the current document and that class doesn't have the GetItem methods,
> this approach doesn't appear to be do-able.

The NotesUIDocument class has a property called Document which gives you
the NotesDocument object.

--

Gary McGinn

Joe

unread,
Aug 20, 1997, 3:00:00 AM8/20/97
to

Joey Chandler <joey_c...@zd.com> wrote:

>2. Using Script, record the value of the field when the user enters it,


>compare it to the value when the user leaves, and document any changes

>in a change history. Works OK, but this would record all the changes to


>a single field during an editing session. I would prefer to note the
>change only when the document is being saved. The question is how do I
>save the original value without having duplicate fields?

You can declare variables in Declarations, read field values from
fields into them in the PostOpen event, and then compare those to the
variables in the QueryClose event. This works, and your log only get's
updated once per editing session.

Joe McGinn
======================================================
Author of Inside LotusScript, available September 1997
http://www.browsebooks.com/McGinn/
======================================================


0 new messages