Subject Re: ibsql - grid/insert problem
Author csswa
Bingo, that's correct, Geoff -- no defined PK causes the problem.

I've also discovered that the following trigger (before insert) can
cause the problem...

new.F_PK = gen_id(gen_shared, 1);

This trigger automatically assigns the next gen_id to the PK
regardless of value entered (and a value must be entered when working
from grids because of the NOT NULL field status). When inserting a
record via grid, if I type in a PK value (a dummy value) higher that
the last record PK value then the inserted record drops off grid. If
I use a PK value of 1, the record remains visible after post.

The switching of the PK value at trigger level is tripping up IBO's
record handling on some level, perhaps.

The trigger issue is a bit of a weird case in that I may be using the
gen in a way that's way off norm. I'm too new at this to know.

Andrew Ferguson

--- In IBObjects@y..., Geoff Worboys (TeamIBO) <geoff@t...> wrote:
> > After inserting a record, manually or with the navigator, and
> > pressing enter or down-arrow or post button, the newly entered
> > record disappears from the grid. It is there though, as revealed
> > hitting the 'refresh all records' button.
> > The error is unpredictable. Sometimes a table performs as expected
> > in these circumstances, showing inserted records, but more often
> > not.
> Andrew,
> Can you confirm whether the problem is only occuring on tables
> defined primary keys?
> --
> Geoff Worboys - TeamIBO
> Telesis Computing