AnsweredAssumed Answered

How to call existing Alfresco.doclib.Actions from custom doc action?

Question asked by why-pengo on Oct 17, 2013
Latest reply on Oct 21, 2013 by why-pengo

I've created a custom document action to wrap the onActionCancelEditing
document action with a warning message, like this:"registerAction", {
    actionName: "sgiOnActionCancelEditing",
    fn: function sgi_onActionCancelEditing(record)
        var displayName = record.displayName;

        var rv = confirm("WARNING! You are about to delete this working copy and any edits you may have made!");
        if (rv === true) {

Also did the share-config-custom.xml change:

            <!– Cancel editing (cancel checkout) –>
            <action id="document-cancel-editing"
                <param name="function">sgiOnActionCancelEditing</param>
                   <permission allow="true">CancelCheckOut</permission>


    <config evaluator="string-compare" condition="DocLibCustom" replace="true">
            <!– js src="components/sgi-object-finder/sgi-cancelEdit-min.js" / –>
            <js src="components/sgi-object-finder/sgi-cancelEdit.js" />

I now have the popup warning and can step through the javascript in Firebug, but
my call to Alfresco.doclib.Actions.prototype.onActionCancelEditing(); does not cancel
the edit. How do I call this method?

Thanks for any help,