Hi All,

Wondering if anyone has coded object removal as yet (for documents other than the current one)?  Basically, two documents both having the same object, when one document removes it's corresponding object I'm trying to remove the "paired" object in another document.

NOTE: this is on a local xwiki install.

Trying to do it with the following:
($f_docName and $objid are set further up to be a valid document and a valid id of the object in that document; same info as would be used by a deleteobject url)

#set($f_linkDoc=$xwiki.getDocument($f_docName))
#set($f_removeObject=$f_linkDoc.getObject("XWiki.LinkObject", $xwiki.parseInt("${objid}")))
$f_linkDoc.addObjectsToRemove($f_removeObject)
$f_linkDoc.save()

In the above, I know that "$f_removeObject" seems valid (checking the result of $f_removeObject.getProperty("track").value returns the expected value for the other document).

Also, "$f_linkDoc" is valid by extension, I would guess - otherwise the "$f_removeObject" would be invalid when checking a property value using

Either way, when I run the above code I get an output of:
$f_linkDoc.addObjectsToRemove($f_removeObject)


Is there something else I should be doing to delete objects manually?  Or perhaps this is not possible via velocity?