BPM, Workflow, and Case

 View Only
  • 1.  Costum Remove from Folder Script

    Posted 18 days ago

    Hello everyone,

    Could you please assist me in customizing the deletion of a document by adding a script action? I've been attempting to do so but haven't succeeded. If anyone has previously done this exercise or has an example that could help me in accomplishing it, I would greatly appreciate it.

    Thank you in advance for the time you've devoted to helping me or for reading my post.

    var self = this;
    require(["icm/action/contentitem/RemoveFromFolder","icm/model/properties/controller/ControllerManager"], function(RemoveFromFolder,ControllerManager) {
    var caseEdt = self.getActionContext("Case")[0];
    var parentFolder = self.getActionContext("CurrentFolder")[0];
    RemoveFromFolder.execute();

    });


    Mehdi ES-SAFI



    ------------------------------
    El Mehdi ES-SAFI
    ------------------------------


  • 2.  RE: Costum Remove from Folder Script

    Posted 14 days ago

    Hi Mehdi,

    I have done this in the past. You can delete the document using "deleteItems" function, which is available on the ecm.model.Repository object. The out of the box Case documents action will just unfile it from the case folder. Make sure the document is not filed in anywhere else and then call deleteItems function.

    deleteItems(items, callback, allVersions)

    Deletes the specified items from the repository.
    Parameters:
    items
    An array of ecm.model.Item objects for the items to delete.
    callback
    A function invoked after the items are successfully deleted.
    allVersions
    If true, deletes all versions of the items.

    Hope it helps!



    ------------------------------
    Regards,
    Ramesh Bhat
    ------------------------------