Adding Files to Advanced PDF Templates

In NetSuite, you can add files, such as spreadsheets, images, or other types of documents to your PDF templates to provide additional information to your customers. You can also add XML files that contain structured, machine-readable data, so your customers can use accounting software of their choice to extract and process invoice details efficiently.

This article provides a step-by-step guide on how to add an attachment to your advanced PDF template.

To add an attachment to your advanced template:

  1. Add a file to the File Cabinet.

    1. Go to Documents > Files > File Cabinet and open the folder where you want to upload the file.

    2. In the top-left corner, click Add File and select the file you want to upload.

    3. Click Open to upload the file.

    4. Click Edit next to the uploaded file.

    5. Check the Available Without Login setting to ensure the file is accessible.

    6. Copy the URL of the file.

    7. Click Save to save the changes.

  2. Edit your advanced PDF template. In this example, an XML file is added to your template.

    1. Go to Customization > Forms > Advanced PDF/HTML Template.

    2. Click Customize or Edit next to the template you want to add the attachment to.

    3. In the top-right corner, switch to Source Code mode.

    4. Add the following line of code to your chosen location.

                          <link type="attachment/data" name="example.xml" subtype="application/xml" src="https://system.netsuite.com/core/media/media.nl?id=2.xml"/> 
      
                        
    5. Make the following updates:

      • Replace the value of src with the URL you copied in Step 1f.

      • Replace any & characters in the link with &amp;.

      • Update the name value with the name of your file (for example, data.xls).

Tip:

Instead of using a link from the File Cabinet, you can also add a reference to a field that contains the path to your file, for example:

<link type="attachment/data" name="data2_document_field.xml" subtype="application/xml" src="${record.custbody4@url}"/>

Related Topics

General Notices