Print PDF on custom module

I have created a custom module called ‘EXPEN_Expenses’ and would like to print PDF’s from it. I’ve already added my module to the PDF template drop down.

Since my module did not have the ‘view.detail.php’ file I copied it across from AOS_Quotes and changed it to reference my custom module.

However, when I try to load the detail view I get this error: ‘There was an error processing your request, please try again at a later time.’

I have attached the log of when I try to load the detail view.

I have also found another topic that suggested to turn of Ajax, but this just loads a blank page.

After searching some more topics I found another suggestion and created a new ‘view.detail.php’ file and have put this in there:

if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');


class EXPEN_ExpensesViewDetail extends ViewDetail {

But I still get the same error.

Any ideas where I might be going wrong?

I found this add on that gives me the functionality without having to bother too much


Didn’t explore you code of view.detail.php deeper then line 30:

as you can see - you missed a space after word function.

May be it will work after correction…
Hope it helps :slight_smile:

Many thanks for the tip Kir.

The adjustment has helped in loading the detail view of my Expenses but the PDF button/ drop down still does not appear.

I’ve restarted my servers to try effect the change but to no avail.