On Wednesday 19 November 2008 03:57:43 am Sibylle Koczian wrote:
> Hello,
>
> I want to do the following, using a Firebird database (which means I can
> use triggers and stored procedures to my hearts content):
>
> Main window shows records from the parent table in a grid, not editable,
> and some fields from one child record belonging to the currently selected
> parent records. One of these fields, call it ChildFieldA, contains NULL at
> record creation. Now this field is filled in and when the record is saved a
> new record is created in the same child table (creation most probably by
> trigger). This record has, again, NULL in ChildFieldA, but one or two other
> fields should be editable at this point. And it would be better to see the
> old record while editing the new one.

If I had to do this (and not use a grid) I would use the afterSave() or the 
Save() of the bizobj.  I'd have two panels.  One to contain the old values 
(or just saved values) and a second to contain the new values.  In the old 
value panel I'd have several read only controls - enough to hold the required 
fields.  Then during the afterSave() or in the Save() I would populate the 
old controls with the data I was saving.  The old controls would not be 
associated with any datasource or datafields.   You even hide the old value 
panel as required.

But if your purpose is to allow editing of the first/just saved record then I 
suggest you  handle all the SQL stuff in code (don't use Dabo routines).  

It is possilbe to have two bizobjs that use the same table but with different 
datasources.  Paul has explained that he does by controling the data 
structure in code.  

It is also possible to play with tempCursors to hold the old data.  

> Of course, at a pinch I could define a view in the database and make it
> updatable by triggers. Or it might even be updatable anyway if it doesn't
> contain a join (must look into my Firebird book). Then one of my bizobjs
> would use this view and the other would use the table itself.
>
> Thank you for hints,
> Sibylle

Views could work for the old value panel.  You did not say the old values 
required any editing - so is there a need to set up triggers?


-- 
John Fabiani


_______________________________________________
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/[EMAIL PROTECTED]

Reply via email to