I just spent a while wrestling some strange behaviour, just in case anyone ever meets the same thing.
It seems that if you create a BAQ with a parameter, and then also use the parameter name as a string constant in table criteria, Epicor can’t handle it. It’s relatively easy to work around, but had me puzzled.
In this case I was working with User Codes. I had a CodeTypeID called “ColourType”. So in the BAQ I added table criteria to limit the returned records to CodeTypeID = ‘ColourType’, and CodeID = @ColourType, having defined that parameter. And nothing was returned, whatever I did.
The generated SQL does work, but that doesn’t help much! It’s annoying having to forego the tidiest and most obvious naming, but renaming the parameter to @ColourTypeIn fixes things.
Apologies if this is old news, but it’s the first time I’ve ever noticed this.