#403 - Name of the generated document - how to set?
hi How to set name of the generated file? Let's say name should be generated (calculated) and contain values of the fields from source record...
hi How to set name of the generated file? Let's say name should be generated (calculated) and contain values of the fields from source record...
10 years ago
The name is generated from the original uploaded template. Let's say, we upload a template named 'mytemplate.docx', then the generated file will be 'mytemplate.docx'.
But you can change this with calculated fields, and BeforeMergeBlock event, assigning $this->Generate_Document_Instance->template_filename (this don't work for PDF generation). Take care of the document name generated when the process is called from Listview. This is a example for Opportunities calculated fields:
function BeforeMergeBlock() { // Not for PDF ... if (!$this->Generate_Document_Instance->enPDF) { $document_name = 'opportunities' . ' - ' . date('Y-m-d');
}
Please, note that this can change in future versions ... maybe a new property to work too for PDF.
10 years ago
sorry, the example code has been corrupted when I upload it. Again with markdown ...
10 years ago
https://gist.github.com/anonymous/d482b68107b83b413c7a
10 years ago
What about the Community Edition with no Sugar logic for calculated fields?
10 years ago
If you mean the Basic version of the component, there is no calculated fields. Calculated fields are present only in Premium version. See "Basic version limitations" section in the readme.txt
10 years ago
Sorry, I'm new to the plugin and if I go to "View pricing" I can see only the Premium version. Where should I find the Basic one?
10 years ago
http://www.sugarforge.org/projects/plantillasword