Announcement

Collapse
No announcement yet.

Duplicate button in modal view

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Duplicate button in modal view

    Hello,

    I would like to add the duplicate button in the modal view of a custom entity.

    I was able to add the button using list.push method in the entity's src/views/modal/detail.js

    However, I am unable to find any "actionDuplicate"Method.

    I tried to go into /client/src/views/record/details.js to find such a method as the Duplicate button is used here but there is nothing to be found but this one :


    Code:
            errorHandlerDuplicate: function (duplicates) {
                this.notify(false);
                this.createView('duplicate', 'views/modals/duplicate', {
                    scope: this.entityType,
                    duplicates: duplicates,
                }, function (view) {
                    view.render();
    
                    this.listenToOnce(view, 'save', function () {
                        this.model.set('skipDuplicateCheck', true);
                        this.actionSave();
                    }.bind(this));
    
                }.bind(this));
            }
    I was curious and tried to put in my modal view code renaming the method actionDuplicate.

    The method is triggered, but I only have an error diplaying in a new modal view "The Record you are trying to create already exists."

    Is there anywhere I can find the method opening the duplication sideview ?

    I tried to grep all the root folder to find actionDuplicate but there is no mthod found.

    Regards,
    Chris

  • #2
    Hello sip63 the actionDuplicate method is defined here: https://github.com/espocrm/espocrm/b...detail.js#L338

    Comment

    Working...
    X