Download PDF button
Downloading PDF's for Cash Sale and Invoices makes it possible for Salesforce-only users to generate documents typically limited to those with NetSuite licenses. Let's see how to get this set up!
So first let's understand how this works. With a solid understanding you'll see it's not rocket science, but it does have some considerations to understand.
First you will notice the PDF is returned to the user at the end. There is no retrieval of stored documents, or storing of the PDF in Salesforce. This means far less data usage in Salesforce, but does mean that the pdf (invoice / cash sale) is re-generated only when needed. Should you update your PDF template that Breadwinner uses at a later time, when you download your invoices they will utilize those new updates. Additionally once set up Breadwinner will be using a copy of the template that NetSuite uses. As you update your NetSuite template you may need to replace the one Breadwinner uses. Finally a prerequesite is that the templates used are Advanced PDF/HTML Templates.
In order to get things working we will need to follow a few steps:
- Installation of Breadwinner script file
- Loading of template file into file cabinet
- Configuration of Breadwinner in Salesforce
As with all configuration, this will require a Breadwinner administrator in Salesforce, and Netsuite configuration should be performed by a NetSuite administrator.
First download the script file from Breadwinner. You will load this into NetSuite and deploy it.
With the file now downloaded in NetSuite, Navigate to Customization > Scripting > Scripts > New.
Upload BREADWINNER's Script file
Save the Script file after completing this form.
Verify the Script File name does not have any spaces in it. As shown, the file is named "download_transaction_pdf.js" Sometimes when uploaded the filename will not be usable by the script engine in NetSuite. Make Sure the GET FUNCTION is enabled and click Deploy Script.
Enable required Permissions as on this Screenshot and Click Save.
The script has been deployed and is ready for use. Store the External Script URL for reference in Salesforce. This will be entered into Breadwinner setup at the end of this guide.
Navigate to Customization > Forms > Advanced PDF/HTML Templates.
Click Edit/Customize on the transaction template (Invoice / Cash Sale) you want to use.
Save the template by clicking Download Template.
The first time you follow this process you might want to keep your Breadwinner template files orderly in their own document folder. If you're just adding more templates or do not want a folder, you can skip down to the Add File portion of this guide. To create the file cabinet document folder, Navigate to Documents > Files > File Cabinet > New
Create a Template Folder and Click Save
Adding a File back to netsuite makes it available for the script to use. Upload the template file downloaded from Advanced PDF/HTML Template.
Store the file’s Internal ID for future reference. This will be entered into Breadwinner setup at the end of this guide.
In the Breadwinner for NetSuite tab in Salesforce, navigate on the left side Setup and Config section, to Configuration -> PDFs. Here is where you will place the Request URL (external URL) that was generated above when the script was installed, and the Cash Sale / Invoice Template Id (internal ID) of the template file uploaded into the file cabinet.
With a properly installed and permissioned script, and PDF templates, you should now be able to click "Download Invoice PDF" which will run and retrieve the invoice from NetSuite directly to your local browser.