Subject Post v/s PostRetaining
Author Claudio Valderrama C.
Hello, all.
I have a M/D relationship and all is working well. However, some fields in
the master are the sum of some fields in the detail. In the
master.BeforePost event I put validation code to ensure some fields are
filled, but they can only be filled once the detail has been filled with
records. The screen is a typical one with edits for the master and a grid
with 4 columns for the detail.
My problem is that the master does a postRetaining when the first row in
the detail is about the be posted. This is clever, since master remains in a
logical state of insert, but it unfortunately triggers my
master.BeforePost's code. So my question is how to tell the difference
between Post and PostRetaining in OnBeforePost event. Does IBO expose some
internal flag?
My code should only execute when the logical Post is done in the master,
after at least one detail's record has been entered, but PostRetaining in
the master is called at the time the first detail's row is posted. I need to
break this chicken and egg problem. Hence, I need to distinguish between
Post and PostRetaining.

C.
---------
Claudio Valderrama C.
Ingeniero en Informática - Consultor independiente
http://www.cvalde.com