Custom Detail View Button

Iā€™ve seen various posts on how to do various types of custom buttons (most of which apply to Sugar and are difficult to implement in Suite), but I havenā€™t yet found anything that will work for what Iā€™m trying to do. I want to add a button to a custom moduleā€™s detail view called ā€œGet PDFā€ that simply returns the value in the recordā€™s moduleTitle div ā€“ i.e., it spits out the value at the top-left of the current page. For now, it can show up in a popup window or something, but returning the value is the important part.

(Ultimately, weā€™re hoping to use this value to run a script that will build a PDF from the related records. But baby steps.)

So far Iā€™ve added this code to the detail viewā€™s buttons array. The button appears, but nothing that Iā€™ve put in the ā€œonClickā€ part has produced a result.

'customCode' => '<input type="button" class="button" onClick="NEED SOMETHING HERE" value="Get PDF">',

Can anyone help? Thanks!

Hi,

I am able ot retrieve the text inside the ā€˜moduleTitleā€™ div with the following:
ā€˜customCodeā€™ => ā€˜ā€™,

However further customization, such as building a PDF, will require far more in-depth customizations.

If you wish to try, you could take a look at the view.detail.php files in the following locations for some ideas as to where to start:
/modules/AOS_Contracts/views/view.detail.php
/modules/AOS_Invoices/views/view.detail.php
/modules/AOS_Quotes/views/view.detail.php

1 Like