"johnf" <[EMAIL PROTECTED]> schrieb: > 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). >
First the old record requires editing: filling in one field. Then the database can calculate most of the values for the new record (needs the value from the field just filled). There is only one field in the new record that may get a value entered by the user (myself, anyway) at this point. So in the meantime I've thought of doing it like this: controls bound to the child table, showing the old record, one or two of them editable. A textbox without data binding for the value I may want to pass to the new record. A button and a method which saves the old record and calls a stored procedure in the database with the right parameters, including the value in the textbox. This stored procedure inserts the new record. After all this, a requery(). There is no bizobj method for calling a stored procedure, is there? So I suppose I'd best use a TempCursor for that? Thank you, Sibylle -- Dr. Sibylle Koczian _______________________________________________ Post Messages to: [email protected] 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]
