Link to home
Start Free TrialLog in
Avatar of andyhines
andyhines

asked on

Notes crash (Red Box) on EmptyTrash command

Hi - I am trying to run a simple formula to empty the trash and then refresh the frame in a Notes application.
The entire command (on a button) is :

@Command( [EmptyTrash] );
@Command( [RefreshFrame]; "Main")

The frame main contains a single unsaved form with 7 embedded views in it.
I have previously marked one or more of the documents in these views for deletion by opening the doc and performing an EditClear.
I now want to actually delete the docs that have been marked.
As soon as I execute the EmptyTrash command Notes falls over and reports a Null Object Handle.

Is this because it doesn't know which view to delete from ? Can I do this a different way ? Am i doing something wrong ?

With Thanks - Andy
I don't want to put the action on a specific view (via a
SOLUTION
Avatar of olaraak
olaraak
Flag of Estonia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Avatar of Sjef Bosman
Sjef Bosman
Flag of France image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of andyhines
andyhines

ASKER

Hi Sjef - Yes it is my continuing saga :)
We launch it tomorrow so I am trying to tidy up the loose ends.
Soft deletions and removal from the view is fine. The users won't care if it is a soft or hard delete. I use EditClear in the Items form which marks it as 'to be deleted'. What should I use to make it a soft delete ? Or as olaraak suggests can I then call the EmptyTrash command or LS equivalent against a particular view/folder (Trash) ??

Thanks - Andy
In Domino Designer Help, there is a document called "Adding a view for soft deletions" where soft deletion is explained.
OK .. I turned on 'Allow Soft Deletions' in the first instance. That should mean that when the user highlights the doc in the view and presses 'Del' or opens the doc and chooses the Delete action (@Command([Clear]) then the document would be removed from the view right ? - and placed in the Trash view.

Previously with SoftDeletions turned OFF then I just got an 'X' next to the doc in the selection column of the embedded view.

What actually happens is that I get no 'X' in the selection column but I do get a message on the status bar saying '1 document marked for Deletion press F9 to refresh'

If I try in a regular view (ie not in an embedded view) then I still get the same 'X' showing in the status bar.

Do I need to do anything to exclude the deleted documents from my regular views ? The type of selection critteria I use is very simple eg  "uses 'Item' form  AND  field Item_Type contains Note "
What am I missing ?

With Thanks - Andy



If you have Domino Designer Help at hand, look for document "Adding a trash folder to an application"
I see that help page and I've added the $trash folder to my application.
Do I have to write the code that puts the deleted document into the trash or does that happen automatically.
How would I exclude deleted documents from normal views - I thought that would happen automatically but maybe not ?
a) should happen automatically
b) ditto
Thanks for the responses. In the end I didn't get it 100% resolved but you did help me understand what was going on. Have split the points by the amount of assistance received - hope thats good for you both - Andy