what u need to do here is write 2 triggers one at the item level i.e. when-validate-item and another at the block level post-query and issues a select statement.