Form Gets Focus & From Loses Focus alternatives
Author: bdorman@essex.ac.uk (bdorman)
Hi Uniface developers! I'm currently working on task to add auditing to a number of database tables used by a Uniface Application. The audit rows are maintained via table triggers on INSERT/UPDATE/DELETE. My intention is to write what screen made that made the db modification (transaction) to an audit row along with other meta data and a snapshot of the data post modification. All user forms for the application in question are modal; therefore any individual database transaction making any modifications to the database (either by a store or sproc) will be done by a single form. I hoped that by setting the db context info on any focus change, I can then retrieve the form name in the sql trigger code to write to the new audit row (code below). Form Gets Focus sql("SET CONTEXT_INFO '%%$formfocus%%%'", ) Form Loses Focus sql("SET CONTEXT_INFO ''", ) Sadly when activating a modal form, the Form Gets Focus Trigger is never called (on activation or clicking on it). This is a very weird behavior as the $formfocus will update to the new active modal form, but no triggers are called to indicate the change in value. My question is; Has anyone previously attempted to maintain a "current" focus at a database/connection level? If possible I would like to avoid duplicating code, so is there any obvious application level triggers or connector trickery I could use to achieve this result? The only solution I can only think of is to set to the context info before any database transaction; however I think that solution would be completely unsustainable due to the number of developers, the scale of the application and the number of different ways the database is modified (custom store code, sprocs, etc). Thank you for your time and responses. Regards, Ben

) the "environment" of an instance of a component. BUT: Hello Uniface, what about some more information, accessibale by proccode at runtime?
Regards Ingo


