Supplying Data to FSM Service Report Templates

Report data is defined alongside template within contents. The template can use the names assigned to that data.

This topic includes the following sections:

Case Report

The following table lists the data supplied to the standard case report.

Data Name

Source and Scope

case

The selected case record.

subsidiary

The case's subsidiary when subsidiaries are enabled.

tasks

CRM tasks linked to the case. The standard search doesn't restrict these to completed tasks.

salesorder

Sales order lines linked to the case.

expenses

Expense report lines linked to the case, when Expense Reports are enabled.

times

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

task

The selected CRM task record.

subsidiary

The task's subsidiary when subsidiaries are enabled.

salesorder

Sales order lines linked through the FSM Task line field.

expensereport

Expense report lines linked through the FSM Task line field, when Expense Reports are enabled.

time

Time bills linked through the FSM Task line field.

image

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

projecttask

The selected project task record.

project

Its project record.

subsidiary

The project task's subsidiary when subsidiaries are enabled.

salesorder

Sales order lines linked through the FSM Project Task line field.

expensereport

Expense report lines linked through the FSM Project Task line field, when Expense Reports are enabled.

time

Time bills linked through the standard activity relationship.

image

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: objectify: false

Mapped Results: objectify Omitted

Case

tasks, salesorder, expenses, times

None of the listed standard report searches.

CRM task

salesorder, expensereport, time

image

Project task

salesorder, expensereport, time

image

The case, task, projecttask, project, and subsidiary data definitions load records. The objectify property doesn't control these definitions as search-result collections.

Check the merged search definition. Omitting objectify from custom JSON retains an inherited false. The search doesn't 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 report-data fragment is 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 doesn't 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 references expense.formulatext. Replacing that formula with an ordinary memo column requires the corresponding template reference to change too.

  • The case report compares task.internalid with item.custcol_nx_task.internalid to 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 doesn't rename a native field. Changing objectify alone doesn't update the XML.

Search Result Limits

The standard report searches don't enable all: true. Standard search retrieval therefore normally returns at most the first 1,000 rows from each search. A successfully rendered report doesn't 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 doesn't remove NetSuite execution limits.

For information about the general behavior and supported locations, see FSM Search Retrieval Limits.

Adding Data to FSM Service Reports

Adding data doesn't 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.

For information about FSM template-tag syntax, see FSM Expressions and Template Tags. For record and search definitions, see FSM Searches and Field Mapping. For information about 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 objectify setting. For more information, see Search Results and objectify.

  • Select only the data needed for the report.

Additional Information

Related Topics

General Notices