need database access before add record

fuehrera

New Member
Hello,
I have a SDV, a SDO and a SDB for Time-booking - records of our users. The records have a from and a to - field.
So I want to make it easier for the users - when the press the "Add-Button" the from field ist automatical filled with the to field of the LAST record.
There is also an individual function - if there is no "last record" for this day, then i want to make a "lookup" to the persons "working time" and fill the from-field with the begin-time from this table.
In adm1 i hacked the code (with direct database-access) into the local-add-record procedure of the viewer - but how should i make it with adm2 - without touching the database???
Is there a possibility to make a "special" SDO??
Or should I make several SDO´s and reference dynamically to "their" data ?

thanx
andi
 
Tip,
ALWAYS avoid altering standard behavior. DO NOT make a special SDO. Instead the route of several SDOs does seem best and the only other solution. I too am starting over in ADM2, ADM1 were excellent and straight forward shame it had probs and got binned. The RUN local-... / excellent syntax and ENGLISH.
 
Andi,

fuehrera said:
when the press the "Add-Button" the from field ist automatical filled with the to field of the LAST record.

Well, you *could* make a call to the server-side section of the SDO from inside addRecord in your viewer. This emulates what you would do in ADM1 I suppose. The problem is that the user could sit in the viewer for 10 minutes before hitting the "save" button, by which time another user could have done the same thing, and already grabbed this field value. So, if you're set on showing the user the field value BEFORE the update, I'd recommend looking into a database sequence. On the other hand, if you can show the field value AFTER the update, I'd do the FIND LAST in postTransactionValidate in the SDO, and leave the field disabled in your viewer.

fuehrera said:
There is also an individual function - if there is no "last record" for this day, then i want to make a "lookup" to the persons "working time" and fill the from-field with the begin-time from this table.

When you say "lookup", I'm assuming you mean that you're gong to offer the user a selection of records. One nice way to approach this is to create an SDO for the table to be "looked up" (if this table doesn't exist in the format that you need, you should create a temp-table SDO instead), and then use a SmartSelect in your viewer. You then control the record set / query of the lookup SDO to control what the user can select from.

Hope this helps,

Andy Smith
 
Back
Top