I think that's pretty humiliating for a 12 year old (whether its a guest that's peed or your own ds). I don't blame him for being cross.
How would you feel if visiting a friend's house and the host demanded to know who hadn't flushed properly?
Better to talk your ds privately after the friends have gone.