by Mike.Sheen » Tue Nov 27, 2018 12:59 pm
This is caused by creating new controls and storing them as fields in the FormPlugin class.
The class is instantiated ONCE at login time, then the methods SetupBeforeHandlers and Setup are invoked when a form loads IF that form was added to the Forms tab of the plugin.
When creating controls and adding them to a form, they'll be destroyed when the form closes - but your fields in the FormPlugin still reference them.
The easiest way around this is to not have these controls as fields - create them in the Setup method and store them in the GenericObjectCollection of the form. When you want to access them, retrieve them from the GenericObjectCollection.
Your plugin modified to do this is attached.
- Attachments
-
- Plugin Purchase order - warehouse convert - Modified to use GenericObjectCollection.xml
- (42.71 KiB) Downloaded 70 times
Mike Sheen
Chief Software Engineer
Jiwa Financials
If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution