callfieldtrigger and Value Changed.
Author: i.sharp@pcisystems.co.uk (Iain Sharp)
The callfieldtrigger proc indicates that it can only be used for help, detail or menu triggers, or extended triggers, has anyone found a backdoor which enables calling value changed? We currently have a 'user defaults' data table, which is capable of storing, for any field painted on any form in our application for a particular user, a default value. When the form is loaded we read the relevant records from the defaults table, populate the fields and run validatefield for the field in order to process the fact that the user has 'changed' the data. We put the logic in the validate field trigger because you can call that code programmatically. The problem with this is that if the data is loaded from xmlload or from a struct, all these fields are marked as requiring validation, and the validate field triggers react, this causes much reloading of data and calculations which should only really be performed if the user has changed the data manually. When I saw that callfieldtrigger was coming, I thought I could use this to allow us to move the code to the VALC trigger, and change our 'defaults' proc to call the value changed trigger, but now we've upgraded to 9.5 I discover that the triggers it can call do not include this one. I don't believe I can use macro to fill in the data, as there could be many fields, on many occurrences, to default in, and that would mean having to use async or something to control the structure editor. I don't like this idea as it seems to equate to chucking balls in the air and hoping they hit their intended targets. So, I'm looking for a piece of proc which reacts to the user entering data in a field using native Uniface behaviour (which is either validate field or value changed AFAIK) and which I can call selectively if the data is filled in by other proc (which is currently validate field (validatefield XXXX) or help, menu, detail (callfieldtrigger YYY, XXX) ) but is not triggered by using proc to change the value of the field (such as xmlload, structtoComponent). Anyone?