I have 85 value lists that are used in about 40 forms. I use setValueListItems to query the data from a SQL database and polulate each value list. The value lists used in each form are populated using a method that is triggered by the form's OnLoad event. This approach works fine, but results in code duplication and unnecessary processing, since the same value lists are used in multiple forms.
I'd like to consolidate the value list code from all forms into a single global method that runs when the Solution loads. I've tried this but get the error message "controller is not defined" when running the code as a global method. The code is exactly the same as in the form methods, compliles fine as a global method, but will not run as a global method.
I haven't been able to find anything related to this on the forum or in the documentation.
Thanks for your help.