Bad code

I broke our online application at work this morning – the one that I’m in charge of, that our customers use to submit reports to us. I didn’t realize I had broken it until I got an email from a customer at noon.

 

Then I had to try to figure out how to fix it before I had to leave with some coworkers on a business trip at 1:00 (more on that later). Luckily, it’s not too hard to delete bad code as long as you remember everywhere you put it.

This was the offending code:

<tr><td><b>AI</b></td><td>${role.agencyInterest.aiNumber}</td></tr>

You may be wondering why an environmental scientist with zero coding training or experience is even dealing with stuff that looks like that. And I’d be wondering right along with you.

But here’s the thing – my team gets automated emails that we have to act on, and the emails don’t include the ID number that we need in order to do anything. So then we have to search an ancient database with a terrible interface to try and find those ID numbers. Which is a major pain in the butt.

There’s other identical code in our application that tells it to go to the ancient database and find the facility name and other useful information, so it stands to reason that it could also go and find the ID number, as long as it has the right field name for the ID number. So this should have worked. I know the field name, and this is the exact same syntax.

But apparently our application doesn’t like searching for ID numbers in that old database any more than we do.