Quick Guide

Start with a mockup

It is always adviseable to start with a mockup. The mockup can be created in Word or PowerPoint for example and should give you (and any other stakeholder) a good idea of how the finished layout should look like, what data it should include and how it should look graphically in terms of colors, fonts, disposition, images etc. Working directly in the editor is usually more time-consuming and you work more towards a moving target compared to if you had already created a mockup.

Consider the below questions before you start creating your layout:

  • How do I want to access the finished layout? Should it be accessible from a specific record, should it be automatically sent out via email, should it be displayed on the dashboard etc?

  • What data should the layout include? Should some data be dynamic? Who should be the audience of the report? Could some information added be sensitive in some way to some of the audience members? What data can be static in the report? Is it likely that texts, headings etc. will be changing often? What drives changes? Do I have the data accessible in NetSuite today or do I need to add some new fields or records to keep track of the information?

  • What should be the look and feel of the finished layout? Do we have a style guide and/or graphic profile that we should adopt? Will the layout only be used internally or will it also be shared externally?

  • Do we need any additional input from the user running the report? Should the user get the change to add data before the PDF is being rendered or being able to filter the content of the report in some way?

Prepare datasets

Once you have your mockup, it is time to prepare your datasets. There are many ways of collecting data to your layout which is why it is good to take some time to review the whole chapter about collecting data and datasets.

The most common way of collecting NetSuite data is by using the Record and/or saved search-based dataset types. If you want your data to be dynamic you need to make sure to that the datasets can be filtered.

For example: Let us assume that you want to make a Customer-based layout and the users should be able to access the layout directly from the customer record using a workflow button. In that case it would make sense to use the Record dataset and pick 'Customer' as the record type. This allows you to access all fields that are stored on the customer record including the customer internal id.

If you then want to add a list of the customer's transactions for example, you can leverage the internal ID to filter the transaction search based on the customer field.

A good rule of thumb is to test if you can add your filter directly in your saved search in the GUI in preview. An example: Pick one specific customer that you want to test with, in this example customer "ABC DEMO AB" with internal id 43. Now I want to include transaction data. In my saved transaction search I can manually add the criterion: Field: "Name", Field operator: "any of", "ABC DEMO AB". I run the search in Preview to verify that I get the results that I want. Make sure to not save the search with this specific criterion though as all criteria added to the actual saved search are hard-coded. In the below example I only want the main line for invoices in my search for example.

The filtering possibilities of datasets are vast including filter expressions etc. This is described in more depth in those chapters.

Create your layout

When you have your data ready you can start by creating your layout.

  1. Navigate to Layouts > Build > Layout Builder and click on New. Enter a name of your layout and select a template from the list (e.g. Basic Company Layout (1) ). Then click on save.

  2. Navigate to the subtab Dataset and click on New Reporter Dataset. Select the type and assign your dataset a name. The name will be used in the code to reference the dataset. Depending on the type, different fields need to be populated.

  3. Repeat this process for each dataset that you want to add.

  4. Go back to the Layout builder and click on Edit.

Since Customer is my base record in this example, the {id} will always be translated to the internal id of the currently selected customer.

If you have a base record defined, make sure to select a record in the field that contains good and sufficient data for you to continously validating the progress and result of your work.

Use the Preview button often to see the current result of your code.

To reference your data, place the cursor where you want to insert the data, right-click and the context menu will show. Go to Components, find the dataset you want to search and find the field or search column. Double-click and the FreeMarker tag will automatically be inserted in the code. Run a preview to see how it looks for the selected base record customer.

Read more about the Layout Builder and Context Menu on how to work with your dataset in the code.

Do not forget to save the record to save your work!

Deploy your layout

TEXT