Deleting a Document ends up corrupting the View


I have a view which lists all the documents and the responses in a hierarchical format. The selection formula I use is
SELECT (form = "My Plan" )  | @AllDescendants

I can create documents and adds responses correctly and they show up in the view as expected.
I can even go ahead and delete responses and the view gets updated accordingly.
However, If I delete a document, I get a Notes prompt "Document Deleted" and I exit and re-enter the database and try to open the view, it displays another unrelated view (View B).

In the designer mode, I can see all the views correctly, but If I try to preview it in notes.. It displays the unrelated View (View B.

I am really confused. I then have to recreate the lost view from scratch, but I can reproduce it every single time. And I am not sure what the problem is and more importantly how to solve it.

I imagine it has something to do with document-responses relationship..but I am not exactly sure what or why or how?

Gurus, any help here would be greatly appreciated.


Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

First thing, Disable the "Allow Soft Deletions" database property.

Second, rebuild the view indexes by running UPDALL (database) -R or by holding down Shift-Ctrl-F9 from a Notes client.

This should fix the problem


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
arask2Author Commented:
The view corruption was traced down to a  particular agent in the database..

1, The agent would innocuously access the view. However, the agent did not have a clause to check whether the view contains any documents.  It would retrieve the NotesDocumentCollection and try to access the first document. This approach was OK as long as the view was not empty. However, if the view as empty, it ended up corrupting the view.  And since the agent had been executed a few times before, I presume, it ended up corrupting the database beyound redemption.

2, I made the necessary changes and rebuilt the database by deleting the corrupted copy and importing the new design. And that seems to have done the trick.

3, However, just to be on the safe side, I have disabled the allow soft deletions. I am not sure, if this would help or harm. I guess, I will  find out.. :)

Thanks for your prompt reply.. appreciate it

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Lotus IBM

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.