How to create a custom PDF of a record view data

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.

Parents Reply Children
  • 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>