Spotting database changes in *FRM entities.
Author: i.sharp@pcisystems.co.uk (Iain Sharp)
We have a user interface requirement/desire to prompt the user for "save changes" on clear and quit, but (to avoid the "cry wolf" issue) obviously only when there have been changes made. We also have non-database fields declared in the model for calculated values etc. It used to be that we could differentiate between modifications which would carry to the database and those which wouldn't by using the $occdbmod. If, however, we switch to using the FRM component subtypes from the model on our forms, this functionality (silently) fails, as nothing is in the database (because the entity isn't a database entity any more). $occmod does not differentiate between db fields and non db fields and therefore is giving many false positives. Am I missing a trick here? Is there some way to know whether the database fields within a FRM component subtype have changed? (Uli - I realise I could probably 'roll my own' by looping through all the fields for the entity and using $properties to determine if it's a database field and then checking something else ($fieldmod?) but frankly it'd be easier to sanity check all the assignments to the non database fields to ensure that they are always done /init, and that is the work I am trying to avoid...)




