Configuring FSM Case and CRM Task Status Automation

Configure which case statuses qualify for automatic opening and which status Field Service Management (FSM) applies when an opening or closing rule matches. The rules use the states of related customer relationship management (CRM) tasks. These four settings control case status outcomes. The settings do not redefine CRM task statuses or configure project task status automation.

For the task lifecycle, rule precedence, selected-task behavior, and processing limits, see FSM Case and CRM Task Status Automation.

Before You Begin

Before configuring the status rules, complete the following:

  • Use account access that lets you edit Field Service Configuration and the applicable case and CRM task records.

  • Identify the intended case Status (status) internal IDs in the account. For closing rules, confirm that the target status has a Stage (stage) of Closed.

  • Confirm that cases have a Case Type (custevent_nx_case_type) value and that the CRM tasks are linked to the intended case. A saved task status change requests processing when the task has a Task Type (custevent_nx_task_type) value. The case rules examine all related CRM tasks, including those without a Task Type.

  • For task-driven closure, confirm that users can save Close Case (custevent_nx_case_closed) on the CRM task. The standard FSM Mobile Details tab labels this field Case Closed. It is read-only for team members and hidden for Project Task events.

  • Confirm that status processing is available through Field Service Scheduled : Status (customdeploy_nx_status). See FSM Script Reference for deployment and execution information.

The standard NetSuite case status IDs used by the standard rules are 1 = Not Started, 2 = In Progress, and 5 = Closed. See Support Case.

Settings and Core Defaults

Standard configuration supplies automatic opening and completed-task Close Case behavior. Automatic closure after all related tasks finish is turned off by default. No custom override is needed to use that baseline when the account uses the standard status IDs.

Go to Field Service > Administration > Configuration. Create an inactive copy of the current configuration. In the copy's Editor, edit the properties in the root status object. Validate and save the copy, then activate it and inactivate the previous configuration. Add the required properties without replacing the account configuration with an example fragment. For the complete revision procedure, see Updating and Validating FSM Configuration.

The following table lists the status properties, accepted values, standard defaults, and effects.

Property

Accepted Value

Standard Default

Effect

status.caseNotStarted

Array of integer case status IDs

[1]

Identifies current case statuses eligible for automatic opening when a related task is In Progress.

status.caseOpenFormula

Formula Text search column specification, as a string

"formulatext:'2'"

Returns the case status ID to apply when the opening conditions are met. An empty result prevents this rule from changing the case.

status.caseCloseFormula

Formula Text search column specification, as a string

"formulatext:''"

Returns the case status ID to apply when at least one related task is Completed and none is Not Started or In Progress. The empty default result prevents this closing rule from changing the case status.

status.taskCloseFormula

Formula Text search column specification, as a string

"formulatext:case when {custevent_nx_case_closed} = 'T' then '5' end"

Supplies a case status ID from a related Completed task. The default formula returns Closed when that task's Close Case box is checked.

Opening and case-closing formulas are evaluated on a case search. The task-closing formula is evaluated on a related-task search. Only results from Completed tasks qualify for task-driven closure. The result is applied to the case, and the task remains Completed.

A formula must return a valid case status internal ID as text, or no value when the rule should not apply. These are NetSuite search formulas, not FSM Mobile expressions. See Using Formulas in Maps in FSM Searches and Field Mapping for the shared search-column syntax.

Note:

Case status names and internal IDs can differ by account. Before using a JSON sample, replace any case status IDs that differ from the verified IDs in your account.

The standard configuration is equivalent to this fragment:

            {
  "status": {
    "caseNotStarted": [1],
    "caseOpenFormula": "formulatext:'2'",
    "caseCloseFormula": "formulatext:''",
    "taskCloseFormula": "formulatext:case when {custevent_nx_case_closed} = 'T' then '5' end"
  }
} 

          

This fragment illustrates the standard defaults. It is not a replacement for the account configuration.

Apply only the properties needed for the intended outcome. See How Custom Configuration Combines with Core Configuration for inheritance and array replacement.

Configure Automatic Case Opening

Use the not-started list to identify the current case statuses from which FSM should open a case.

To configure automatic case opening:

  1. Set status.caseNotStarted to the complete list of account case status IDs that should qualify for automatic opening. Include every intended status. Inherited entries are not added to a replacement array.

  2. Set status.caseOpenFormula to return the intended case status ID. For standard In Progress, use "formulatext:'2'".

When a related task is In Progress, FSM applies the formula's result to a case in the configured list during status processing.

The not-started list classifies case statuses for this rule. It does not change the task statuses or create a NetSuite case stage. Use "formulatext:''" for status.caseOpenFormula if the opening rule should return no status.

Important:

Opening is evaluated before the Closed-stage check used by the closing rules. Including a Closed status in caseNotStarted can allow a case in that status to reopen when a related task is In Progress. Include only statuses from which opening is intended.

Configure Case Closure

Choose whether a completed task can close its case independently or whether all related tasks must be complete. Automatic opening is evaluated first. If it does not apply, closing rules are evaluated only when the case stage is not Closed.

These settings govern FSM's status rules but do not prevent manual case status changes or changes by other account automation.

Case closure can also lead to automatic closure of a linked project when the separate model conditions apply. Review models/case in FSM Record Model Configuration when cases are linked to projects.

Let a Completed Task Close Its Case

Retain the standard status.taskCloseFormula to close a case when a completed task has Close Case checked. Other related tasks can remain Not Started or In Progress.

To let a completed task close its case:

  1. Retain the standard status.taskCloseFormula, or replace '5' with the account's verified Closed status ID. Keep the field reference and checkbox condition when retaining Close Case behavior.

  2. Save Close Case on the intended task as part of the completion scenario. In the standard FSM Mobile Details tab, use Case Closed and synchronize the change.

When more than one completed task returns a closing result, FSM selects the qualifying task with the latest Start Date (startdate). It applies that task's formula result to the case. It does not use the latest completion timestamp to select the task.

Changing Close Case on an already Completed task does not itself change the task status. After changing that box or a formula, check the Update Status (custevent_nx_status_update) box on a case with a Case Type value. Save the case to request another evaluation.

Enable Closure When All Related Tasks Are Complete

To add automatic case closure and retain the Close Case rule for completed tasks, set status.caseCloseFormula to return the intended Closed status ID. For the standard Closed status, merge this fragment:

              {
  "status": {
    "caseCloseFormula": "formulatext:'5'"
  }
} 

            

This formula turns on automatic closure when at least one related task is Completed and none is Not Started or In Progress. The task-based closing rule still takes precedence and can close a case before all related tasks are complete.

Require All Related Tasks to Be Complete

To require all related tasks to finish before FSM closes the case, set status.caseCloseFormula to return the intended Closed status ID. Set status.taskCloseFormula to return no value:

              {
  "status": {
    "caseCloseFormula": "formulatext:'5'",
    "taskCloseFormula": "formulatext:''"
  }
} 

            

Use the account's verified Closed status ID in place of 5 when necessary. A completed task with Close Case checked will no longer close the case independently. A case with no related tasks does not qualify for automatic closure.

When Status Rules Apply

Status processing reads the configuration when the script starts. Changes can affect pending and subsequent requests. Activation alone does not request processing for every case.

Saving a status change on a CRM task with a Task Type value requests processing. Saving a case with the Update Status box checked also requests processing. When FSM submits the case update, it clears the case's Update Status box, even when no rule changes the case status. Unrecovered processing errors can prevent the affected action from completing. See FSM Case and CRM Task Status Automation, FSM Script Reference, and the Field Service Error Record topic.

Closing writes Field Service End Date (custevent_nx_end_date) and Field Service End Time (custevent_nx_end_time) from the selected task's Field Service End (custevent_nx_task_end), falling back to its scheduled end (enddate). Conversion uses the case's Field Service Time Zone (custevent_nx_time_zone). All-tasks closure selects the Completed task with the latest Start Date. Changing a status formula does not change that date selection.

With Track Service Time enabled and a Service Time Item (custrecord_nx_task_type_time_service) set on the task type, the task waits for time processing. Time processing must clear the Field Service Log Activity Time (custevent_nx_time_log_activities) box, and the task must reach Completed before qualifying for closure. FSM Mobile can show completion before the NetSuite task status becomes Completed. See FSM Service Time Tracking.

A case without related tasks is not automatically closed. Closing rules leave an already-Closed case unchanged when the opening rule does not apply.

Disable or Restore Rules

The following table shows how to turn off or restore each status rule.

Intended Outcome

Configuration Change

Consequence

Turn off automatic opening.

Set status.caseOpenFormula to "formulatext:''".

The opening formula returns no status. Closing rules can still apply.

Turn off automatic closure after all tasks complete.

Set status.caseCloseFormula to "formulatext:''".

Restores the standard value for this rule. Task-based closure can still apply.

Turn off closure driven by an individual completed task.

Set status.taskCloseFormula to "formulatext:''".

The completed task's Close Case checkbox no longer produces a closing result through this rule. Automatic closure can still apply if turned on.

Turn off both closing rules.

Set both closing formulas to "formulatext:''".

These rules return no closing status. Task completion processing continues.

Restore the standard behavior.

Restore the four values listed in Settings and Core Defaults, or remove the applicable custom overrides where the inherited values are the standard values.

Restores standard automatic opening and task-based Close Case behavior. Automatic all-tasks closure is turned off.

Removing an override does not turn off an inherited rule. Restoring configuration does not reverse case statuses or end fields already written, clear outstanding requests, or cancel a running execution.

Related Topics

General Notices