The Layout Builder

You have now successfully started the processing of building a new layout. The aim of this section is to explain how to navigate the Layout Builder record and all its sections and settings. This chapter will also explain some of the more important functions available on this record that will help you in your daily work with the tool.

Basic Navigation

Please note that the record must be in Edit mode in order for you to be able to see the Editor itself.

User help

  • BFO HTML Manual: A link to BFO User manual. This is the most important manual because it describes the difference between ordinary HTML and BFO: s implementation.

  • BFO User Guide

  • FreeMarker Manual: The tool will generate some FreeMarker code by default, but sometimes that is not enough. Use this manual as an encyclopaedia for creating advanced freemFreeMarker arker statements in the layout to make it more dynamic.


General

  • Name: Give a descriptive name for your layout.

  • Description: Optional. Add a description of your layout that is useful for you and your colleagues. Field is only used for internal purposes.



Editor

To make the code more structured and easier to work with, the Editor section gives you the possibility to work with the HEAD, CSS, MACRO and FUNCTIONS in its own sections. The code in each respective section can then be fetched and embedded in the template code when the engine is rendering the PDF. However, if you prefer you can keep the full code in the first Template section of the editor.

From the editor you can also access the Context menu which gives you access to all available data as well as some useful capabilities. Make sure to read the chapter Context Menu for more details.

Template

  • The main section of the template and constructs the full XML used for rendering the layout.

  • Used to define the body and the content of the layout.

  • The HEAD, CSS, MACRO and FUNCTIONS sections are optional. If the code is not added directly to the Template section it must be referenced as in the example code above.

HEAD

  • The HEAD section should contain all code that is part of the HEAD but that is not the style or macrolist. Note that the <HEAD> tag is part of the template.

  • Examples of information to place in this section is dimensions and margins of the layout.

  • Accessed through the {{{include_head}}} directive from the Template section

CSS

  • Section for the style sheet and describes how the HTML code should be presented, including fonts, font-size, tables etc.

  • Accessed through the {{{include_css}}} directive from the Template section

Macro

  • Section for the macrolist and is most often used to define header and footer of the layout

  • Accessed through the {{{include_macrolist}}} directive from the Template section

FUNCTIONS

  • Section for any FreeMarker functions that you might want to add to your layout

  • Accessed through the {{{include_functions}}} directive from the Template section

Dataset

The dataset capability is one of the most important cornerstones of this tool and depending on the required data you can have more or less datasets connected to your layout. When we add data to our layout we do this with the help of one or multiple Dataset records which can be found under the subtab Dataset in the Layout Builder. Once a new dataset has been added, it can be printed in your layout. The tool supports several types of datasets, including record, saved searches, custom font files, graphs and value fields.

Read chapter Add Data for more details.

Settings

File Name Syntax

In the File Name Syntax field on the Settings subtab you can decide how the PDF files should be named. Since NetSuite will overwrite files with the same name it is also important that the name is created for each file created. To create the name it is possible to use some of the built-in variables below or harded-coded values:

  • {id} : The internal id of the current Layout Builder record

  • {name} : the name (entered in the Name field) of the layout

  • {number} : a sequential number starting from 0. This will help you keep the file name unique as the number will update for each new file created.

Example: {id}_{name}_{no}.pdf

You can also include fields from your record- or search datasets when setting the file name. Note that the $ is

Examples:
Invoice_{Trx.Internalids[0].DocNumber}.pdf
{Project.companyname}_{no}.pdf

Folder to Save PDFs

By default all files are stored in the bundle folder/pdfs. It is possible however to store the created files in another folder in the file cabinet with the help of the Folder to Save PDFs field. You can do this in some different ways:

  • Set the internalid of the folder in the file cabinet

  • Type an absolute path, for example "User Documents/My Folder".

The field called Folder ID will display the internal of the folder that will be used. Please note that any setting made here can be overwritten by the deployment configuration if settings for folder is applied there.

Optimization Settings

Read more about how to optimize your reports here >>.

Theme Settings

TO BE ADDED

Deployments

Your layouts can easily be deployed in your NetSuite account using the Deployment record. One layout can have none, one or multiple Deployment records depending on how you choose to deploy your created layout. Read chapter Deployment for more details.

The Deployment record is the most efficient and easiest deployment method. However, if your deployment needs require more customization you might want to use other methods to deploy your layouts. Read chapter Deploy your Layouts and its subsequent chapters for more details on the different deployment methods and which one you should choose for your layout.

Preview, Make Copy, Delete and Save As Template

The tool also includes some useful capabilities that will help you with your layouts, both when it comes to creating new ones but also when it comes to data management. This section describes these functions in more depth.

Preview

In edit mode you can choose to preview your PDF based on your current datasets and code whenever you like. Click on the Preview button and the PDF will show in a pop-up window.

Please note that if you have base record, you must first select a record from the Record ID (Base record) field.

Make Copy

In view mode you have the option to copy a layout including all attached datasets using the Make Copy button. When creating a copy, all saved searches used in the datasets will also be copied to avoid having the same search referenced by more than one layout.

Read the chapter Build a layout on more details on how to copy an existing layout.

Delete

If you want to delete a layouts including all its dataset records and saved searches, open the record in edit mode and navigate to Actions > Delete.

Please note that the deletion process will also delete all linked saved searches. Therefore, make sure not to use the same saved search for multiple layouts.

Save As Template

If you have designed a layout that you would like to make available as a template when creating new layouts, you can use the Save As Template button which is displayed in edit mode.

When used, a new User Template record will be created and stored in your account. These templates can then be used as a starting point when creating new layouts.