` Printed Icetips Article

Icetips Article



ABC: Updating related files with parent file
1999-03-31 -- Dan Pressnell
 
Newsgroups: topspeed.products.c5ee

> I added to SaveBuffer method after the NExt(), but same problem ...
>
> It must be impossible that nobody has used the Relate.Update() method
> before, because, for me, it is not working !!!!

The documentation falls a little short here.  The
relationmanager only updates with cascades, etc., if you prepare the
record you are updating before you make the changes to it.  Here is the
sequence you must follow:

   relate:file.save  ! "snapshot" current record
   !  make your changes to the record here.
   relate:file.update ! do the update

The save method (savebuffer might not do this) saves the current key
fields that you might be changing, so that when you do the update
method, the class can compare to see if anything has been changed.  If
there is a change to a key field, then the cascade kicks in.  Without
the save method, the class doesn't know about any changes, because it
doesn't know what the initial state of the key values were.

Dan



Printed November 23, 2024, 3:30 am
This article has been viewed/printed 35399 times.
Google search has resulted in 5 hits on this article since January 25, 2004.