Announcement

Collapse
No announcement yet.

How to link entity form to Template for Print it

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

  • How to link entity form to Template for Print it

    I create form " receipt voucher " and create the template with the same name, to print it as PDF, As the image.

    How can I link them and Print the data
    Attached Files

  • #2
    Hello

    you need to override detail view


    and add the button and define the action

    Code:
    setup: function () {
                Dep.prototype.setup.call(this);
                this.dropdownItemList.push({
                    name: 'printPdf',
                    label: 'Print to PDF'
                });
    }
    
    actionPrintPdf: function () {
                this.createView('pdfTemplate', 'Modals.SelectTemplate', {
                    entityType: this.model.name
                }, function (view) {
                    view.render();
    
                    this.listenToOnce(view, 'select', function (model) {
                        window.open('?entryPoint=pdf&entityType='+this.model.name+'&entityId='+this.model.id+'&templateId=' + model.id, '_blank');
                    }, this);
                }.bind(this));
            },

    Here you can see an example http://forum.espocrm.com/forum/devel...uestion-newbie

    Comment


    • ming
      ming commented
      Editing a comment
      where's the code should be located?

  • #3
    Thank you very much ,

    Comment

    Working...
    X