I had a small issue crop up in AX a couple of weeks ago. It wasn’t big enough to spend any time on, but it was a bit of an annoyance. Well, I had some spare time yesterday, so I decided to see if I could fix it. The end result was that I did indeed fix it, but the journey to that point was kind of ridiculous, so I thought I’d write it up.
AX has a built-in compare tool, for comparing different versions of code in different AX layers, or in source control. It’s not a terribly great tool, and I’d rather have WinMerge or Beyond Compare, but it’s good enough. The initial form shows the names of the two files being compared, with a red box next to one, and a blue box next to the other, to indicate the colors that will be used to highlight the differences between the two files.
Well, the color in those little boxes mysteriously disappeared a couple of weeks ago. The tool still works, and the text is highlighted in red & blue, but there’s no visual indication of which text is from which file. Not a really big deal, but inconvenient.
Most of the tools built into AX are written in X++, and we have full source, so I went ahead and dug up the source for the form named “SysCompareForm.” I don’t think I should post any of the source here, but what I found is that those little red and blue boxes were actually HTML controls, each one displaying a web page, constructed in the code! I’d never really noticed before, but the boxes were not actually displaying solid red & blue, but rather were displaying red-to-white and blue-to-white gradients. And, of course, this being Microsoft, they were doing so in a way that only worked in older versions of IE. And, yeah, I’d recently upgraded IE on my VM from 8 to 10. So that was the problem: each of those little squares was actually rendering a web page with IE, just to get little red & blue swatches!
The cross-browser gradient situation has been a bit of a mess for a long time now, and you generally need to add about 10 lines to your CSS file just to do one gradient that works well across all browsers. So, I tried to update the code so it would render out OK in IE 10. Well, I messed around for a while, and couldn’t quite get it right. Then, I did some searching, and found this thread from a Russian web site, from someone else who had the problem and solved it. So, I just copied his code and went on with my life.
Apparently, this problem was fixed by Microsoft in a recent CU, but I guess it’s one that we haven’t applied yet. I wonder how much other stuff in AX is being done like this, and relying on HTML/CSS that only works in IE 8. Geez.