Can't open any job in Job Entry or Job Tracker

Hi all,
Found a weird one today and I thought I’d share it here - I run my scripts to update the Test and Pilot environment with a copy from the Live. All is fine in the Pilot, but Test has an issue - I can’t open any jobs using Job Entry or Job Tracker. As soon as I type in the job no or search & select it, I get a server error. I tried different jobs, companies, Epicor clients and users and was getting the same error every time.
After wrecking my head with it, I found that, a while ago, I was trying something totally different in the TEST system and I added a custom field to the OrderRel table. And of course I forgot about it. So I went in the Admin Console and regenerated the data model for Test and all is fine now.