Key Field Usage

paul_pichette

New Member
Another question has popped up, that I can't find in the on-line help (v 9.1.c).

When you design a maintenance screen to have key fields that are updatable only in 'add' mode, how do you enable the field so that it is a required key field? I think that in ADM 1, we had an ADM-CREATE-FIELD custom list for this.

Also, if I don't want to have the key fields updatable, but rather want the system to generate a new sequential number, what's the best way to do this? in an SDO override procedure?
 
If you use the over-rides for

displayRecord to disable the fields

and

addRecord to enable the fields

you can easily manage this.

The best way to get the system to generate a sequential number is to set up a sequence on the database and assign it in the create trigger. That way it doesn't matter whether the record was created through the SDO or by another means.
e.g.

TRIGGER PROCEDURE FOR CREATE OF MyTable.

ASSIGN MyTable.SequenceField = NEXT-VALUE(sMyTable).
 
Top