Deleting Document - Code Included

I am trying to delete a document via the web. I open the document with ?OpenDocument and then on a hotspot button I have the following code:

if ( confirm(‘Delete this document?’) ) window.location.search = ‘?DeleteDocument’;

This does not work - I have searched this forum and this is the answer that I am getting - it seems to work for everyone else!!!

Is there some setting I need to have enabled to be able to do this? I have posted this question before and Stan replied that it may have something to do with the ? - should it be

%3F

Others say I cannot delete an open document…

Any ideas or suggestions would be greatly appreciated. Thanks in advance.

Subject: Deleting Document - Code Included

I bet your problem is not deleting the document. Here is a way to confirm this without doing any code. Edit a URL in your browser after opening a document. Change “?OpenDocument” (or equivalent) to “?DeleteDocument”.

So, what is your problem. I don’t think you posted enough code or context for us to know. If the above works, review your form and the JavaScript in it to see what URL is being generated. Do some debugging and you will probably find the URL is not good.

Subject: RE: Deleting Document - Code Included

I’m going to try it right now - I’ll let you know.

Thanks!

Subject: RE: Deleting Document - Code Included

I did as you suggested and I got the same response - I am taken to a generic screen set up by our administrator indicating that my user name or password is incorrect and to contact our help desk.

Could the delete not be permitted, for some reason?

Once again, thanks for your help - it is really appreciated.

Subject: RE: Deleting Document - Code Included

If I access the document through my notes view, and get the ID from the Document Properties, and post it into my address bar with ?DeleteDocument, the document is successfully deleted.

The only difference that I can see is that instead of the url generated when I use code:

/intranet/MicroSem.nsf/Region/##########?DeleteDocument

when the view name, Region, is replaced with a number, then it deletes the record.

Subject: Stupid, stupid, stupid mistake -

I had the wrong viewname included.

Sorry to take up your time - but thanks for the help!

Subject: RE: Deleting Document - Code Included

Don’t just say “does not work”. What does happen, exactly? Omit no detail, however slight.