This should get all documents with form = "PVApproval" and Status = 2
The code above works fine but only if is executed using the debuger; if I run this as Schedule Agent or from the Notes client using the option RunOnServer then count alway returns 0.