` Printed Icetips Article

Icetips Article



Par2: How To Determine The Record Successfully Insert When Press OK Button
2005-01-04 -- Maarten Veenstra
 
> The Insert is actually done by the .TakeCompleted method (in the form).
> So in the .TakeCompleted method, after the parent call, test the value that
> was returned by the parent call.

If I may expand on that:
When the form is called for Change and nothing was changed
when the [Ok]-button was pressed, TakeCompleted will return
RequestCompleted but nothing is written to disk!
You must check Primary.Me.EqualBuffer() to determin if
there is an actual write. However, when this form is called for
Delete, EqualBuffer() will tell you nothing has changed but
the record -was- deleted from the file.
So, my complete code is:
  IF SELF.Response = RequestCompleted AND |      !Check for real changes
  (NOT SELF.Primary.Me.EqualBuffer(SELF.Saved) OR SELF.Request = DeleteRecord)
    !Action! - do something
  END



Printed November 21, 2024, 7:10 am
This article has been viewed/printed 35257 times.