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
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
You have a couple of mistakes in your smarty:
first the foreach statements need to be inside html comments
<!-- {foreach from=$po_purchase_order_ori_order_request_item_1 item="contact"} -->
and
<!-- {/foreach} -->
Second, it looks like you are pulling items from a PO so they are probably not "contacts"
which means that these fields are probably incorrect:
<td>{$contact.name}</td>
<td>Email {$contact.email1}</td>
<td>{$contact.status}</td>
Your code will most likely look more something like:
<!-- {foreach from=$po_purchase_order_ori_order_request_item_1 item="item"} -->
<tr>
<td>{$item.name}</td>
...some other fields here like quantity, etc.
</tr>
<!-- {/foreach} --> </tbody>
Thanks Francesca Shiekh for your suggestion I will try according this.
laxmichand
Thanks Francesca Shiekh for your suggestion I will try according this.
laxmichand