Below is the example of using the DeleteObjects operation to delete multiple objects from the repository. The request contains moniker of repository connection and description of deleted objects.
{ "DeleteObjects" : { "tMb" : { "id" : "S2!M" }, "tArg" : { "objects" : { "its" : { "d" : [ { "@isShortcut" : "false", "@isLink" : "false", "@hf" : "false", "i" : "NEWFORM1", "n" : "NewForm1", "k" : "8205", "c" : "1538", "p" : "4294967295", "h" : "false" }, { "@isShortcut" : "false", "@isLink" : "false", "@hf" : "false", "i" : "NEWFORM2", "n" : "NewForm2", "k" : "8206", "c" : "1538", "p" : "4294967295", "h" : "false" } ] } } } } }
{ "DeleteObjectsResult" : "" }
The specified DelObjects function deletes several repository objects. The monikers of repository connection and description of the deleted objects are sent as input parameters of the function. The result of the function is the result of the operation.
Object descriptions can be obtained by means of the FindObjectById function, which code is given in the Getting Object Description by Its Identifier example.
public static DeleteObjectsResult DelObjects(MbId mb, Od[] objects) { var somClient = new SomPortTypeClient(); //Proxy object for operation execution //Operation execution parameters var tDel = new DeleteObjects() { tArg = new DeleteObjectsArg() { objects = new Ods { its = objects } }, tMb = new MbId() { id = mb.id } }; //Delete objects var result = somClient.DeleteObjects(tDel); return result; }
See also: