Hi Tanya,
Good day!
My question is in conjunction with below question:
http://forum.espocrm.com/forum/devel...quote-template
I am now being able to create a child view modal of the create document (views/modal/edit). But, I am having issues on how to attach the pdf or file to the form after selecting a Quote template for printing PDF.
How would I be able to modify the View of the modal with attachments already? I already tried to attach the attachmentsIds and attachmentsNames in to the model by passing the attributes from the ajaxPostRequest for getting Email attributes that contains the PDF attachments.
Good day!
My question is in conjunction with below question:
http://forum.espocrm.com/forum/devel...quote-template
I am now being able to create a child view modal of the create document (views/modal/edit). But, I am having issues on how to attach the pdf or file to the form after selecting a Quote template for printing PDF.
How would I be able to modify the View of the modal with attachments already? I already tried to attach the attachmentsIds and attachmentsNames in to the model by passing the attributes from the ajaxPostRequest for getting Email attributes that contains the PDF attachments.
Code:
actionSaveAsDocument: function () { this.createView('pdfTemplate', 'Modals.SelectTemplate', { entityType: this.model.name }, function (view) { view.render(); this.listenToOnce(view, 'select', function (model) { this.notify('Loading...'); this.ajaxPostRequest('Quote/action/getAttributesForEmail', { quoteId: this.model.id, templateId: model.id }).done(function (attributes) { alert('done'); console.log(attributes); this.createView('quickCreate', 'views/modals/edit', { scope: 'Document', attributes: attributes, keepAttachmentsOnSelectTemplate: true }, function (view) { alert('rendering'); var attributes = view.attributes; model.set({ attachmentsIds: attributes.attachmentsIds, attachmentsNames: attributes.attachmentsNames }); console.log(view); console.log(model); this.notify(false); view.render(); }); }.bind(this)); }, this); }, this); },
Comment