I’m trying to rewrite a little formula that will roll through all of the documents in a database searching for rep/save conflicts. When it finds a rep/save conflict, I want it to set a field named “Deleted” to “Y”. Doing this will remove it from all of the views that the users see - basically, soft deleting it. Because of business needs, I do not have the option of hard deleting the document.
I currently have it set to run from the Action menu and it is set to act on all documents in the database. When I run the agent with this formula, it kicks off and seems to run, but doesn’t delete any of the replication/save documents that are in the database.
If someone could take a look at what I have below and point out any errors, I would really appreciate it.
From what I can tell, this formula should do the following…
If form doesn’t = “FormA” or if Form = “FormB”, then it stops running. If finds the opposite to be true, then it moves down to the next line.
If it doesn’t find any conflicts, it stops running. If it finds a conflict, then it moves down to the next line.
On the documents found that match the above criteria, the formula will set the field “Deleted” to “Y”
I know that the “Select @All” statement is thrown in there to tell the formula what docs to run on, but I still haven’t figured out why it has to be at the end of the formula.
Seems to me like this should be working, but I’m just a dumb admin getting aquainted with the wonderful world of formula language. Whee!
you don’t need to add a filed to your rep/save conflict docs as there is already a field that determines whether it is a conflict. Just add code to your views to exlude any docs with the field $Conflict (SELECT !@IsAvailable($Conflict)). The create another view with the selection formula SELECT @IsAvailable($Conflict) and this will hold all of the conflict docs (make sure show response docs in hierarchy is deselected in the view properties). Now you can just run a simple agent against this view to delete any docs in it.
On second thought… maybe it wasn’t the formula that was the problem after all. I just created an agent to run the Simple Action of changing the ‘‘Deleted’’ field value from “N” to “Y” only on selected documents and even that failed change the value of the field.
It’s a Computed when composed field, but that shouldn’t be a problem, should it?
Subject: RE: Having trouble with a deletion formula
You state “I just created an agent to run the Simple Action of changing the ‘‘Deleted’’ field value from “N” to “Y” only on selected documents and even that failed change the value of the field.”
Are you looking at the value of the DELETED field through document properties after you run your agent?
Subject: RE: Having trouble with a deletion formula
I too am having trouble creating and setting field values on a rep/sav conflict document.
I have a formula agent that sets a hand full of fields with deletion values that causes the document to appear in a different view to be hard deleted later, but nothing happens when the document is a rep/sav conflict.
Could it be that the $conflict field prevents actions like this?
If anyone knows of a work around, I sure would appreciate it.