If you’re Advanced PDFing a saved search, it is not uncommon to include a formula field in your results. Referencing that field is easy if you know where to look.
I needed a report that compared our estimated cost (from the sales order) to the vendor PO where we actually purchased the product. In our business model, those two costs don’t always match. In some cases, we get a rebate. Rebates affect our financial reporting at the sales order level and thus at the sales rep level as well. The standard reports in NetSuite were helpful but fell short of our needs. Time to write a report of my own!
The time-consuming dilemma was mapping formula fields in the saved search results to references in the Freemarker code of an advanced PDF template. It was super easy once I finally figured out where to look. Here is the report. As you can see, I’ve got several calculated fields.
And here’s the trick. When you create your advanced template by clicking “New Template” on your saved search.
Before you switch to source code editing, get a screen print of your mapped field names.
Then, when you switch to source code editing, you have your list of fields which can be referenced in your Freemarker code.
Here’s what that looks like.
This is so easy, you might be asking yourself, “Is this worthy of a blog article?” In looking for this answer, I searched on things like “Advanced Template Joins” and “Formula Fields in Advanced Templates.” I found nothing. Hopefully, next time I can’t remember how to do this, I’ll land here!