Subject RE: [IBO] Insert and Post
Author Riho-Rene Ellermaa
> > When I checked the IBO code there was indeed SysPost
> > function in Insert.
> <...>
> > Is this normal, or am I missing some parameters somewhere? In
> > BeforePost I do some data checking and now the user gets
> > errormessage even before he has chance to do anything.
>
> SysPost operates as...
>
> if State = dssSearch then
> SysPostSearch( true )
> else
> if NeedToPost and
> ( not IsPosting or
> ( IsRetaining and not IsPostRetaining )) then
> begin
> <...>
> SysBeforePost
>
>
> So it should only call SysBeforePost when there is a "NeedToPost".
> That is, SysPost is called to ensure that any existing changes are
> posted prior to starting a new Insert or Edit etc. So it would seem
> that for some reason IBO thinks your dataset needs to post. Is there
> any chance you are calling Insert recursively somewhere in your
> application (check your call stack).
>

Doesn't look like double Insert.
I noticed that BeforePost() is called after AfterInsert(). If there were
double Insert()'s, then shouldn't the Post occure before Insert?.
Maybe it's something to do with my query. It looks like:

SELECT id,(select account from account a where a.id=m.accid) as accountno
, BNAME
, VALDATE
, DOCDATE
, DOCNO
, SIGN1
, SIGN2
, INFO
,BADDRESS
FROM account
join for_pay m on account.id=m.accid
where uid=:UID and install=:INST
for update

Riho-Rene Ellermaa
senior programmer
Hansabank