Hi.
Try to change casting in your code to:
Runfactory a8 = (Runfactory)test.RunFactory; Run a9 = (Run)test.LastRun;
Br, Tomas
[If my advice solves your issue or query, please mark the thread as solved. Clicking on KUDOS star is the best way how to say thank you.]