Hello everyone,
I want to generate a custom PDF in record view. And want to add button for pdf in Edit button dropdown as par below image.
Want to show record view data in PDF as table format.
Hello everyone,
I want to generate a custom PDF in record view. And want to add button for pdf in Edit button dropdown as par below image.
Want to show record view data in PDF as table format.
PDF Manager handles adding the item in the menu when there is a published PDF for that module.
As for adding data from related records you will need to do some customizations.
See Cédric Mourizard's post
sugarclub.sugarcrm.com/.../how-to-customize-the-sugar-pdf-manager
PDF Manager handles adding the item in the menu when there is a published PDF for that module.
As for adding data from related records you will need to do some customizations.
See Cédric Mourizard's post
sugarclub.sugarcrm.com/.../how-to-customize-the-sugar-pdf-manager
Thanks Francesca Shiekh
I will try this.
laxmichand
Hello Francesca Shiekh,
I have tried it but getting the error:
TCPDF ERROR: The class SugarpdfSmarty has to be extended and you have to set a location for the Smarty template.
My code is:
<?php
require_once 'include/Sugarpdf/sugarpdf/sugarpdf.pdfmanager.php';
class PO_Purchase_OrderSugarpdfPdfmanager extends SugarpdfPdfmanager
{
public function preDisplay()
{
$GLOBALS['log']->fatal("pdf bean->name ".$this->bean->name);
parent::preDisplay();
$previewMode = false;
if (!empty($_REQUEST['pdf_preview']) && $_REQUEST['pdf_preview'] == 1) {
$previewMode = true;
}
if ($previewMode === false) {
// Select links to add
$linksToLoad = array('po_purchase_order_ori_order_request_item_1', 'po_purchase_order_poi_purchase_order_item_1');
foreach ($linksToLoad as $linkName) {
// @var PO_Purchase_Order $this->bean
$this->bean->load_relationship($linkName);
$linkedBeans = $this->bean->$linkName->getBeans();
// Prepare data
$linkedData = array();
foreach ($linkedBeans as $linkedBean) {
$linkedData[] = PdfManagerHelper::parseBeanFields($linkedBean, true);
}
// Assign data to template
$this->ss->assign($linkName, $linkedData);
}
}
}
}
laxmichand
Hello Francesca Shiekh,
I have applied it according to https://sugarclub.sugarcrm.com/dev-club/b/dev-blog/posts/how-to-customize-the-sugar-pdf-manager but if I add assigned variable in PDF Manager then getting 500 internal error. Let me know if there are any issue in my code.
My code in PDF Manager:
{if isset($po_purchase_order_ori_order_request_item_1item) and $po_purchase_order_ori_order_request_item_1item|@count gt 0}
<table style="width: 100%;" border="0">
<tbody>
<tr>
<td><strong>Name</strong></td>
<td>Email</td>
<td>Phone</td>
</tr>
{foreach from=$po_purchase_order_ori_order_request_item_1 item="contact"}
<tr>
<td>{$contact.name}</td>
<td>Email {$contact.email1}</td>
<td>{$contact.status}</td>
</tr>
{/foreach} </tbody>
</table>
{/if}
Thanks
Laxmichand saini
laxmichand
Hello Francesca Shiekh,
One more question for that how to apply pdf manager according conditionally.
1. I want show download button only if Category = Vet Check and Category = Test.
2. I want to print different pdf if Category = Vet Check and Category = Test.
Please let me know how to manage.
Thanks,
Laxmichand saini
laxmichand