I apprecaite this is a well documented subject but I am trying to Print from a custom Module I have created (Create a PDF Report).
I have made alterations to files as per the enclosed but get an error stating;
“There was an error processing your request, please try again later” when altyering the detailview.php within my custom module.
I have disabled Ajax as instructed but the error still occurs.
The Code that effects the error is when i place (within Detailview.php) the following line;
// add option like this (may vary slightly but function is the same, if list is different exclude “4 =>”) 4 => array ( 'customCode' => '<input type="button" class="button" onClick="showPopup(\'pdf\');" value="{$MOD.LBL_PRINT_AS_PDF}">',
Do I need to make any alterations in php.ini?
Any advice would be greatly appreciated.
The Full instructions and code I am following is listed below (instructions), this code seems popular on this Forum for printing PDF from Custom Modules.
Many Thanks in advance.
Adding Print PDF Function to any module in SuiteCRM.
1 ) First We need to add your custom module in to *Type drop down of PDF template module
This We can do it by going to Admin > Drop Down Editor, We need to search for pdf_template_type_dom drop down list and add -> option
Item name [ your custom directory name ] : To find the proper name path, FTP into the SuiteCRM server and go to modules and use the exact name used on your module file Display label [ Whatever name you want ]
Save it .
2 ) After this We need Print as pdf option in our details view page of custom module
- to add option in details view page open detailviewdefs.php
we can find this file under /custom/modules//metadata/detailviewdefs.php
we need to add option in to buttons array
array ( '
buttons' =>
array (
0 => 'EDIT',
1 => 'DUPLICATE',
2 => 'DELETE',
3 => 'FIND_DUPLICATES',
// add option like this (may vary slightly but function is the same, if list is different exclude “4 =>”)
4 => array ( 'customCode' => '<input type="button" class="button" onClick="showPopup(\'pdf\');" value="{$MOD.LBL_PRINT_AS_PDF}">', ),
save it and check if you are not able to see the option. <-optional but recommended to make sure everything is good at this point.