I'll take it from you question that you are not familiar with the functionality of the SDO.
The SDO provides several validation hooks which fire when they exist. In other words you just need to put an internal procedure with the name of the validation hook into your static SDO or its logic procedure. Now it's important to know whether you use Dynamics or the ADM2 ( Dynamics takes the ADM2 as its base and adds a lot on top of it ... ) and in case you use ADM2 whether you use the logic procedure or not in order to determine which of them are available to you:
Here's a list ( I think their names speak for themselves ):
- rowObjectValidate - this is a client-side validation hook because it lives in the client-side proxy of the SDO. Therefore you should only put code into it that does not need a database connection. For example you validate whether a field that must be populated is populated or not, a date lies in the future or in the past.
- createPreTransValidate, writePreTransValidate, deletePreTransValidate - these are only available with Dynamics or with ADM2 when you use the logic procedure and these are server-side. That means that you have access to the database but you are before a transaction is started - ideally to validate the validity of foreign fields.
- preTransactionValidate - this is available in plain ADM2 but, IMHO of course, you should use the above mentioned in favor of this one as you would need to branch your logic on the rowMode attribute of the rowObjUpd Temp-Table to know whether it's a creation, update or deletion ...
- createBeginTransValidate, writeBeginTransValidate, deleteBeginTransValidate - these are server side immediately after the transaction has been started. Ideally to automatically assign object identifiers.
- beginTransactionValidate
- createEndTransValidate, writeEndTransValidate, deleteEndTransValidate - these are sever-side immediately before the transaction ends. Ideally to automatically assign calculated values or values in dependent tables. ( But it's subject to discussion whether it would be better practice to call their SDO instead ...)
- endTransactionValidate
- createPostTransValidate, writePostTransValidate, deletePostTransValidate - these are server side immediately after the transaction has been committed. Ideally for example to print an order or send a confirmation email which should not be part of the transaction itself.
- postTransactionValidate
The functionality is such that a non-empty RETURN-VALUE will be interpreted as an error and the save process bails out immediately presenting the RETURN-VALUE as an error message to the user.
I think you'll get the meaning of these procedures.
As I've never used the SDB for update for the reasons I've mentioned - I can't tell you about the ESC key ...
Don't get me wrong, but: Working with the frameworks and not against them takes a lot of knowledge and experience. So don't take it lightly - neither should your boss - you will need education here, or, as an alternative hire an experienced consultant. By experienced I mean with ADM2 and/or Dynamics. Otherwise you will end up frustrated not achieving what you want.
Heavy Regards, RealHeavyDude.