Deletion of document from view by selecting 'Delete' option of Pop-up menu

Hai Everybody, There are some “Pop-up” menu shows on right click of any documnet in the view such as → cut, copy,paste, delete. i want to delete document by slecting “Deltete” option from pop-menu in the view based on condition as Status=“approved”.where i have to write the code.

i have tried in → Sub Querydocumentdelete(Source As Notesuidatabase, Continue As Variant) of database resource.

but when i started debugger it is not invoking this function, so where i have to write.