Not sure where I should file this one. Maybe in the Simple things I really should know by now section or the Things I should probably investigate thoroughly before blogging about section (alongside crying wolf over LotusScript bugs). Maybe you can help me decide?
It's to do with the way the RestrictToCategory URL command behaves and it's something that caught me off guard just recently.
Ignore the fact that these links use a Category parameter in the URL. This is just my way of keeping the URL simple. This "bug" is still the case when using a standard RestrictToCategory call.
Is this "as designed"? Is there no equivalent to Exactmatch? There should be! If I say show me this category that's what I want to see. Not just something close to it.
There's a reason I'd not noticed this behaviour before. When using RestrictToCategory it's normally with categories that I know to exist. Take the articles view on this site. Notice the View By Category links on the right? They're built using an @DBColumn to the same view and so the categories have to exist.
There's a reason I noticed this behaviour. For each user of a system I wanted to check if they had any request documents in the database. This was done using Ajax. The requested XML was from a view at requests?ReadViewEntries&RestrictToCategory=jh10. The category is the user's ID. In this case it was user jh10 and I was expecting it to tell me there were no requests in the system. You can imagine my surprise when it told me there were three. Turned out they were for user jh100!
solution fudge hack workaround to this is to close the category string with some random characters. In the column that is categorised change the formula to FieldName+"$*%" or something. Then the XML requested is requests?ReadViewEntries&RestrictToCategory=jh10$*%. The chance of a partial match should be close enough to zero to live with.
What's probably going to happen (now I've spent 30 minutes writing this out) is that the first person to comment will point out how wrong I am and I'll feel stupid (again!). If not then I am right and this doesn't make sense. Surely it should be an exact match?!