Our audit system records any edits a user makes to any field. Now I am
trying to decrease the amount of text needed.
On After Start EEP sets the table name in .vTableName and runs this
Custom Form Action to set existing field values:
SELECT +
ZRiskPersonNote,ZRiskFamilyNote,ZRiskSafetyNote +
INTO +
aZRiskPersonNote INDIC a1, +
aZRiskFamilyNote INDIC a2, +
aZRiskSafetyNote INDIC a3 +
FROM Z_Risk_Info WHERE ZID = (.vZID)
Every Form field has an On Exit EEP like this:
SAVEROW
SET VAR aCurNote NOTE = (.aZRiskPersonNote)
SET VAR aNewNote NOTE = .RBTI_Form_ColName IN .vTableName WHERE ZID =
(.vZID)
SET VAR vA_Type TEXT = 'Note'
RUN SELECT CmdCode FROM RMD_FILES WHERE CmdName = 'Audit_ZNote'
CLEAR VAR vA_Type
RETURN
The RUN SELECT CmdCode compares aCurNote to aNewNote, resets the 'a'
variables, and if there are any changes, it records the original value
and the new value plus user, computer, date, time and other info which
allows me to reverse the changes.
What I would like to do is put the On Exit EEP in a Custom Form Action
and get the Exit EEP down to one line calling that CFA.. The hold up is
I cannot figure out how to load 'aCurNote' with the correct 'a' value
variable from the Select command. If the field is 'ZRiskPersonNote'
then I need 'aZRiskPersonNote' loaded to 'aCurNote'. Right now I simply
add the 7 line Exit EEP to each field and edit in the correct 'a'
variable for 'aCurNote'. I have tried multiple combos of
('a'+.RBTI_Form_ColName) to replace the 'a' variable in the 'aCurNote'
line which all end up as simple text of "aZRiskPersonNote" not the value
of '.aZRiskPersonNote'. There are often 10-20 fields in a form which all
have to be specifically set for the correct 'a' variable. The difference
is my current 7 lines x 10 fields = 70 lines vs my idea of 1 line x 10
fields = 10 lines. The current 7 line Exit EEP works well. I just keep
coming back to this one line idea (obsession?) every time I create a
form. Any ideas appreciated.
Tom Frederick
President/CEO
Elm City Center
1314 W Walnut
Jacksonville, IL 62650
W- 217-245-9504
F - 217-245-2350
E - [email protected]