I have a new table and form, both called Settings. This is to replace setting some variables in code in my InitialSetup function. Table fields are SettingName, SettingType and SettingValue.
SettingType is a combo on the form with possible values Text, Number, Boolean and JSON.
SettingValue stores the actual value as text, regardless of type. it is a Memo field.
I also have user fields for each type of setting. These are initially hidden, and each one is shown depending on SettingType. So if SettingType is JSON, then the SettingJson text control (also a Memo) is displayed.
When a record is shown, the InitSettingValue function runs. part of what it does is load the SettingValue into the appropriate visible control. So for JSON, it basically does a pretty-print of the JSON value into the SettingJson unbound field.
This works fine on the initial load, but I’m having trouble getting it to work after the field (or record) is saved.
I put InitSettingValue in the new On Finish event for the form. I was told this event would fire AFTER the record was saved. As you may remember, the On Complete event actually fires before the record is saved, and prevents the actual saving of the record.
What I expected to happen is that when I change the text of SettingValue, then save the form record, it should redisplay the SettingJson field, including any changes made to SettingValue. This is not happening.
I must actually move to another record, then move back to see the formatted changes in SettingJson.
Is there a way to refresh the form data via code?
Is the On Finish event not firing as expected?
My original intent was to call code in the On Validate event immediately after changing the field value to refresh the visible field. But that won’t work either.
Can you suggest a way to make this work?
Thanks…