FSM Service Report Configuration
Service report configuration controls the PDF produced for a case, CRM task, or project task. It selects the report template and supplies record and search data. It also controls the Service Report button for PDF previews and email requests.
A service report PDF and its email message use separate templates. Changing the PDF template does not change the email body, recipients, or automatic sending rules.
This topic covers:
How Service Reports Are Rendered
FSM uses the FreeMarker template renderer in NetSuite and BFO (Big Faceless Organization) Report Generator to produce service report PDFs.
The following table describes the report rendering stages.
|
Stage |
Purpose |
|---|---|
|
Prepare report data |
FSM resolves the configured records, searches, and other named values in the attachment's |
|
Render the template with FreeMarker |
FreeMarker inserts those values into the XML template. Its directives control conditional content and repeated rows. The result is an XML document. |
|
Generate the PDF with BFO |
NetSuite converts the rendered XML into a PDF using BFO's report format, including page layout, tables, fonts, images, headers, and footers. |
The HTML email body is rendered separately with FreeMarker. It is not converted to a PDF by BFO.
Requirements for Custom Templates
Customize a copy of the applicable standard XML template and select it with contents.template. NetSuite provides the rendering engines. Your custom file supplies the template. Follow these requirements:
-
Retain the XML declaration, BFO document type, and
<pdf>root used by the standard templates. Use well-formed XML, with closed elements and quoted attributes. -
Use BFO-supported elements and styling for PDF layout. Browser HTML and CSS support do not establish what the PDF renderer supports.
-
Use FreeMarker references such as
${task.title}to display supplied data,<#if>for conditional content, and<#list>for repeated rows. Match the data names and result shapes described in Supplying Report Data. -
Handle missing values and empty collections. Apply appropriate formatting for numbers, dates, and Boolean values.
-
Escape inserted text and attribute values for XML where required, including characters such as
&and<. Use the escaping appropriate to the template's FreeMarker output format. Do not assume automatic escaping is enabled. -
Use template features supported by the rendering environment in NetSuite.
FSM configuration template tags and FreeMarker references can both use ${...}, but each is evaluated in a different context. Configuration tags prepare the report definition and data. FreeMarker references use the named data supplied to the XML file. For information about configuration tags, see FSM Expressions and Template Tags.
Template Authoring References
The following table lists template authoring references.
|
Reference |
Use |
|---|---|
|
Product overview and public landing page for the PDF engine. |
|
|
XML report structure, layout elements, and styling. |
|
|
Public landing page for the template engine. |
|
|
Template syntax, directives, data handling, and formatting. |
|
|
Introduction to inserting values, conditions, and lists. |
|
|
NetSuite: Source Code Editing to Customize Advanced Templates |
NetSuite guidance for XML templates that use FreeMarker and BFO. |
The NetSuite reference explains template syntax. FSM selects service report files through configuration and the File Cabinet. For instructions to select a file, see Selecting a Custom Report Template.
Where Service Reports Are Configured
The standard PDF is a named attachment within a notification email definition.
|
Record |
Notification Definition |
PDF Definition |
|---|---|---|
|
Case |
|
|
|
CRM task |
|
|
|
Project task |
|
|
The three definitions are separate. Updating one does not update the others.
The corresponding button properties are configured under "views/case/servicereport", "views/task/servicereport", and "views/projecttask/servicereport".
Use FSM Configuration for configuration merging, activation, JSON validation, and Preview. Use FSM Notification Configuration for email definitions, senders, recipients, subjects, and automatic sending rules.
Core Report Definitions
The following table lists the standard PDF templates and default report file names.
|
Record |
Standard PDF Template |
Report File Name |
|---|---|---|
|
Case |
|
|
|
CRM task |
|
|
|
Project task |
|
|
For the corresponding HTML email templates, see Core Email Definitions.
These template references are relative to the FSM script folder in the File Cabinet. For a custom template stored elsewhere, use its full File Cabinet path.
Each standard attachment has type: "pdf". Its contents object contains the XML template reference and the data supplied to that template.
The standard automatic notification rule arrays are empty. The presence of a service report definition does not itself enable automatic sending. Manual report actions and automatic notification rules are separate controls.
Report File Properties
The following properties apply to the generated report attachment, such as notification.taskEmail.servicereport.attachments.servicereport.
|
Property |
Accepted Value |
Standard Value or Fallback |
Effect |
|---|---|---|---|
|
|
|
|
Converts the rendered XML into a PDF. |
|
|
File name string. |
Omitted in the standard definitions. The rendered template's |
Sets an explicit file name. Include the intended extension. |
|
|
Object containing |
Record-specific standard definition. |
Supplies the template and its data. |
|
|
File Cabinet path string. |
Record-specific XML template listed in Core Report Definitions. |
Selects the file used to render the PDF. |
|
Additional properties within |
Named record definitions, searches, or JSON data appropriate to the template. |
Varies by report. |
Supplies data under those names for the template to use. |
Use contents for the report attachment and body for the email message.
Keep the service report PDF as the first attachment returned by the notification definition. The record's PDF preview returns that first rendered attachment. Adding an attachment before it can change what the Service Report action opens.
The standard attachments object includes array: true, which combines its named entries into the attachment list. Preserve this control when extending the existing object. If replacing it with an array, include every attachment that should remain available and preserve the PDF's position.
Selecting a Custom Report Template
Preserve the supplied template and work from a custom copy. Copy the template for the relevant record type so that its expected data and layout are retained.
To select a custom report template:
-
Locate the XML file selected by the merged configuration.
-
Save a custom copy in the File Cabinet.
-
Modify the copy using valid XML, FreeMarker syntax, and BFO-supported layout. See Requirements for Custom Templates.
-
Change the corresponding
contents.templatereference.
The following custom configuration fragment changes only the CRM task PDF template and its file name. Replace the example path with the File Cabinet path of an existing file.
{
"notification": {
"taskEmail": {
"servicereport": {
"attachments": {
"servicereport": {
"name": "Task_Service_Report.pdf",
"contents": {
"template": "/Templates/FSM/task-service-report.xml"
}
}
}
}
}
}
}
Merge these properties into the existing custom configuration. The inherited PDF type, report data, email body, and recipient settings remain unless changed elsewhere. The explicit file name overrides the file name supplied by the template's title.
This changes the existing servicereport definition, so references to that definition use the revised PDF. Creating a differently named definition does not automatically copy the standard definition or select it for a button or automatic rule.
For a separately named report, supply a complete notification definition with the required email body and PDF attachment. Update the applicable button's notification property or notification rule. Keep its data definitions compatible with the selected record type.
Supplying Report Data
Report data is defined alongside template within contents. The template can use the names assigned to that data.
Case Report
The following table lists the data supplied to the standard case report.
|
Data Name |
Source and Scope |
|---|---|
|
|
The selected case record. |
|
|
The case's subsidiary when subsidiaries are enabled. |
|
|
CRM tasks linked to the case. The standard search does not restrict these to completed tasks. |
|
|
Sales order lines linked to the case. |
|
|
Expense report lines linked to the case, when Expense Reports are enabled. |
|
|
Time bills linked through the case or its CRM tasks, as selected by the configured searches. |
The supplied case XML template arranges related work by task. Preserve the identifiers and record relationships it uses when changing its searches.
CRM Task Report
The following table lists the data supplied to the standard CRM task report.
|
Data Name |
Source and Scope |
|---|---|
|
|
The selected CRM task record. |
|
|
The task's subsidiary when subsidiaries are enabled. |
|
|
Sales order lines linked through the FSM Task line field. |
|
|
Expense report lines linked through the FSM Task line field, when Expense Reports are enabled. |
|
|
Time bills linked through the FSM Task line field. |
|
|
Supported image files attached to the task. |
Project Task Report
The following table lists the data supplied to the standard project task report.
|
Data Name |
Source and Scope |
|---|---|
|
|
The selected project task record. |
|
|
Its project record. |
|
|
The project task's subsidiary when subsidiaries are enabled. |
|
|
Sales order lines linked through the FSM Project Task line field. |
|
|
Expense report lines linked through the FSM Project Task line field, when Expense Reports are enabled. |
|
|
Time bills linked through the standard activity relationship. |
|
|
Supported image files selected from the project task's FSM file folders. |
The data names differ between reports. For example, the case report uses times and expenses. Task reports use time and expensereport. Copying template content between reports requires matching its data references.
Search Results and objectify
Match template field references to each search's effective objectify setting. For mapped versus native results, map-name handling, conversions, merging, sorting, and summary operations, see Returning Mapped Values or Native Search Results. The report-specific settings and XML examples follow.
The following table lists the effective objectify settings for the standard report searches.
|
Report |
Native Results: |
Mapped Results: |
|---|---|---|
|
Case |
|
None of the listed standard report searches. |
|
CRM task |
|
|
|
Project task |
|
|
The case, task, projecttask, project, and subsidiary data definitions load records. The objectify property does not control these definitions as search-result collections.
Check the merged search definition. Omitting objectify from custom JSON retains an inherited false. The search does not change to mapped results.
Field Names in Report Templates
Distinguish the name of the report data collection, a property name within the map, and the NetSuite search column name.
The following fragment shows the standard CRM task report's time search within notification.taskEmail.servicereport.attachments.servicereport.contents:
{
"time": {
"record": "timebill",
"filters": ["custcol_nx_task", "is", "${ task.id }"],
"map": {
"item": "item",
"duration": "durationdecimal",
"billable": "isbillable"
},
"objectify": false
}
}
This is a report-data fragment, not a complete account configuration. The supplied XML uses the outer data name time and the native fields:
<#list time as part>
<p>${part.durationdecimal} - ${part.isbillable}</p>
</#list>
The map property duration selects the durationdecimal column. It does not create a duration field in these native results. If you change the search to objectify: true, update the template to use mapped properties, such as part.duration and part.billable. Account for the converted values.
Two other standard examples illustrate the same dependency:
-
The expense report search maps a Formula Text column to
memo, but the native-result template referencesexpense.formulatext. Replacing that formula with an ordinarymemocolumn requires the corresponding template reference to change too. -
The case report compares
task.internalidwithitem.custcol_nx_task.internalidto place sales order lines under the relevant task. Preserve that relationship and the template's references when changing the map or result type.
The mapped image searches work differently: their templates use the map properties img.url and img.description.
Changing a map name alone does not rename a native field. Changing objectify alone does not update the XML.
Search Result Limits
The standard report searches do not enable all: true. Standard search retrieval therefore normally returns at most the first 1,000 rows from each search. A successfully rendered report does not establish that every matching row was retrieved.
Where a report requires more rows, all: true can be set on the individual resolved report-data search. Retain selective filters because retrieving more rows can increase generation time and processing usage. Increasing retrieval does not remove NetSuite execution limits.
See Retrieving More Than 1,000 Results for the general behavior and supported locations.
Adding Data
Adding data does not make it appear automatically. The XML template must also contain the text, field reference, table, or image that displays it.
For additional JSON data that must retain 0 or false, store the values inside a named object. The current renderer skips standalone data properties with values of 0, false, an empty string, or null. Those properties are unavailable as named template variables.
For example, this fragment belongs within contents:
{
"reportDetails": {
"visitCount": 0,
"followUpRequired": false
}
}
The template can read reportDetails.visitCount and use reportDetails.followUpRequired in a condition. Within JSON data supplied to the renderer, null values are normalized to empty strings. Check absent data separately from zero or false values.
For example, this configuration fragment adds a fixed note to the CRM task report data:
{
"notification": {
"taskEmail": {
"servicereport": {
"attachments": {
"servicereport": {
"contents": {
"reportNote": "Contact our service team if further work is required."
}
}
}
}
}
}
}
To display it, add the following fragment at the appropriate location in the custom XML template:
<p>${reportNote?html}</p>
This reference uses FreeMarker syntax in the XML file. FSM template tags in configuration JSON are a separate processing step. For example, the standard CRM task record definition uses "id": "${ task.id }" to select the record before the XML is rendered.
Use FSM Expressions and Template Tags for FSM template-tag syntax and FSM Searches and Field Mapping for record and search definitions. For XML and FreeMarker authoring, see Source Code Editing to Customize Advanced Templates.
When adding or changing searches:
-
Retain filters that restrict results to the selected case, task, or project task.
-
Preserve the data names and result shapes expected by the template.
-
Check empty results as well as records with multiple related rows.
-
Match template field references to the search's effective
objectifysetting. See Search Results and objectify. -
Select only the data needed for the report.
Layout Properties for Task Reports
The standard CRM task and project task XML templates use the following values within their PDF attachment's contents object.
|
Property |
Standard Value |
Purpose |
|---|---|---|
|
|
|
Expected logo height in pixels, used in the template's scaling calculation. |
|
|
|
Header height in pixels. |
|
|
|
Page width in pixels. |
|
|
|
Page height in pixels. |
|
|
|
Page margin in pixels. |
|
|
|
Spacing used between image columns, in pixels. |
|
|
|
Number of image-grid columns. |
|
|
|
Assumed image size in pixels, used to calculate display resolution. |
|
|
|
Footer height in pixels. |
These values are inputs to the standard task report templates. Changes to these properties affect a custom template only if the template uses the properties. Use positive dimensions, a positive whole-number column count, and sufficient page space for margins and columns.
The following configuration fragment changes the CRM task image grid to two columns:
{
"notification": {
"taskEmail": {
"servicereport": {
"attachments": {
"servicereport": {
"contents": {
"body": {
"columns": 2
}
}
}
}
}
}
}
}
The other inherited layout properties remain.
The standard case template defines its layout directly in XML, including A4 page size and header and footer dimensions. It does not use this task-report layout property set. Adding these JSON properties to a case report does not by itself change the supplied case layout.
Standard default JSON for the CRM task report template and layout properties (record and search data remain inherited):
{
"notification": {
"taskEmail": {
"servicereport": {
"attachments": {
"servicereport": {
"type": "pdf",
"contents": {
"template": "templates/taskreport.xml",
"logo": {
"height": 75
},
"header": {
"height": 125
},
"body": {
"width": 750,
"height": 1060,
"margin": 25,
"gutter": 25,
"columns": 3,
"imagesize": 1080
},
"footer": {
"height": 60
}
}
}
}
}
}
}
}
Images and Branding
The standard task reports include an image data source. Layout properties control how selected images are arranged without changing the original files or the records that own those files.
body.imagesize does not resize uploaded images. It supplies an assumed size for the XML template's display calculation.
The standard case report does not define an equivalent image-gallery data source. Adding a gallery requires both suitable data selection and matching XML template content.
The report data can include a subsidiary record for branding when subsidiaries are enabled. The XML template determines which logo, address, and contact fields appear.
Preserve the configured mappings for image addresses when extending standard searches. A file that displays in FSM Mobile does not establish that the PDF renderer can retrieve it.
Language and Translations
Service reports use the service notification's selected language. For customer, subsidiary, and account fallbacks, see Language and Translations. To set the language fields or custom collection references, see Configuring FSM Localization and Translation.
The report and email templates are rendered using that language. FSM translation identifiers in the templates can provide translated labels. Hard-coded text added to a custom template does not automatically acquire translations.
The selected template must support the required characters, fonts, date and number presentation, and custom text.
Service Report Button Configuration
The three button definitions have the same property structure. The following sections describe each definition because the notification families and record conditions differ.
Case - views/case/servicereport
The standard button is available in view mode when the case has a Field Service Case Type and its stage is Closed. Its notification value selects a definition from notification.caseEmail.
CRM Task - views/task/servicereport
The standard button is available in view mode when the task has a Field Service Task Type and its status is Completed. Its notification value selects a definition from notification.taskEmail.
Project Task - views/projecttask/servicereport
The standard button is available in view mode when the project task has a Field Service Task Type and its status is Completed. Its notification value selects a definition from notification.projectTaskEmail.
Button Properties
These properties apply separately to each of the three view definitions.
|
Property |
Accepted Value |
Standard Default |
Effect |
|---|---|---|---|
|
|
Boolean. |
|
When |
|
|
Page-button ID string. |
|
Identifies the button on the form. Retain this ID unless you need to change it. Avoid duplicate IDs. |
|
|
Label string or FSM translation identifier. |
Record-specific translated Service Report label. |
Changes the button text. |
|
|
Name of a definition in the corresponding notification family. |
|
Selects the notification definition used by this button. |
|
|
Confirmation text or a translation identifier. Use |
Record-specific translated confirmation message. |
Nonempty text enables the preview-and-confirm action. An empty string selects preview only. |
|
|
Message string or translation identifier. |
Record-specific translated success message. |
Displays after the send request succeeds. This is not proof that the recipient has received the email. |
|
|
Message string or translation identifier. |
Translated generic error message. |
Displays if the send request fails. |
|
|
Nonnegative number of milliseconds. |
|
Delay before displaying the confirmation after the preview window loads. |
For example, this custom configuration fragment makes the CRM task button preview-only:
{
"views/task/servicereport": {
"send": ""
}
}
The selected notification definition and PDF remain. This change removes that button's send confirmation and send request. Other actions or automatic rules can still send the same notification.
PDF preview still renders the associated notification definition. Retain a valid email-body template even when this button is configured for preview only.
Changing label, name, or notification does not remove the standard record eligibility conditions.
When a user confirms sending, FSM queues the selected notification for processing. A successful request is distinct from PDF generation, background processing, and receipt of the email. Use FSM Service Reports and Notifications for the product behavior and FSM Script Reference for associated execution and deployment information.
The preview and the queued email are rendered separately. If record data or configuration changes before notification processing, the emailed report can differ from the earlier preview.
Performance Reference
For performance measurement and data capture, see FSM Performance and Data Collection.