How to link entity form to Template for Print it

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Mosaadms
    Junior Member
    • May 2017
    • 14

    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
  • tanya
    Senior Member
    • Jun 2014
    • 4308

    #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?
  • Mosaadms
    Junior Member
    • May 2017
    • 14

    #3
    Thank you very much ,

    Comment

    Working...