Hi Paul, thank you very much for your answer.
This is working:
when setting the correct class name as parameter.
The original description of the problem was too short. In the original sourcecode (not the example I posted here) I only had an Object available, and not the class Categories itself. Besides that, I also passed the wrong object instance to getField, not really knowing that it had to be an instance of the class Categories.
I figured out how it works, using an Object instead of Categories itself:
The output is:
Jesper, thank you for the good, short answer and the tips regarding the initialization of my variables
Thank you,
Oliver