No Generate Letter under Contracts

I have created 1 PDF Template with Type = Contracts. I have created a Contract and tried to Generate Letter after I have checked the contract under the Delete, but the Generate Letter doesn’t show in list.

Thanks

Hi unikbit,

If I’ve got your question right, you do not see the Generate Letter option in the actions menu of Contracts.

If that’s the case, go to modules/Contracts/metadata/detailviewdefs.php and look for ‘AOS_GENLET’ in the buttons array.

If not present, go to custom/modules/Contracts/metadata/detailviewdefs.php and add,

‘AOS_GENLET’ =>
array (
‘customCode’ => ‘’,
),

in the buttons array.

Next on, add the generate letter functionality. To do this, edit the view.detail.php file in custom/module/Contracts/views directory. If there is no such file or directory create it. You can look at archive.h2ik.co/2012/03/sugarcrm-upgrade-safe-way-to-extend-views/ to how to create the file. Now add the following piece of code in the display() method,

require_once(‘modules/AOS_PDF_Templates/formLetter.php’);
formLetter::DVPopupHtml(‘Custom_Module’);

1 Like

maybe I look at the wrong side but even on the demo is not working

its not on list view its on detail view

1 Like

you have right, I had to click on contract and under Edit button I have found Print to Pdf, if you have only 1 PDF template defined is not asking if is good or not, but if you have 2 PDF templates let you choose the right contrcat.

Thanks a lot

I have a new problem, when I try to Print as PDF for Contracts, the page freeze and will not download the PDF. It freeze at this url: http://127.0.0.1/sugarcrm/index.php?entryPoint=generatePdf

If I try Generate Letter for Account is working

I have used this thread to solve it
https://suitecrm.com/forum/installation-upgrade-help/2941-no-generate-letter-under-contracts#11760

thx