Docs
On this page
task2 min readApplication: Platform

Create a record from another record

Set up reclassification field maps and a table operation that creates or updates one record from another, such as a request from an incident.

Set this up when agents need a button that turns one record into another, or fills one record from another. The field maps decide what is copied, and a table operation runs the copy. Interactions already have this for every work type.

Before you begin

  • You need the administrator role to create the table operation. Users with application_administrator or configuration_administrator can maintain the maps afterwards.
  • Know the source table and the target table by name, not label, for example Incident and ITSMRequest.
  • Know which source fields go to which target fields. The names do not have to match.

Steps

  1. In the Administration workspace, go to Catalog & templates → Record rules → Reclassification field map.

    The Reclassification field map item in the Record rules section of the Catalog & templates menu.
  2. Create one map for each field to copy. Set Source table, Source field, Target table and Target field. Set Special type for journal, HTML and attachment fields. The fields are described in Reclassification field maps.

    The empty Create Reclassification field map form, with Source table, Source field, Target table, Target field and Special type.
  3. If the same pair of tables needs a second set of maps for another button, give those maps a Unique map name.

  4. Go to Scripting & automation → Scripts → Table operations and create an operation on the source table. Set Operation type to Execute on server and choose where it shows. See Table operations.

    The Table operations item in the Scripts section of the Scripting & automation menu.
  5. In Server script, call ReclassificationUtil.reclassifyRecord with the source record, the source table and the target table. It returns the ID of the new record.

    var newRecId = ReclassificationUtil.reclassifyRecord(current, "Incident", "ITSMRequest");
    
    answer = [{
        id: newRecId
    }];
    
  6. To apply only the maps of one Unique map, pass its name as a fourth argument.

  7. In On success, open the new record with Navigate.to({ urlElements: ["ITSMRequest", response.id, viewAspect] });.

  8. Save the operation and test it on a record in a test instance.

Result

The button appears on the source records. When an agent selects it, Servicely creates the target record with the mapped fields and opens it. Change the maps later to change what is copied, without touching the operation.

Variations

Update an existing record

To fill a record that already exists, pass the unique map, true and the target record’s ID. Servicely uses this to resolve a record on zero contact.

ReclassificationUtil.reclassifyRecord(current, "Incident", "ITSMRequest", "ZeroContactResolved", true, existingTargetId);

The arguments, in order, are:

  1. the source record
  2. the source table
  3. the target table
  4. the unique map, or null for the default maps
  5. true to update rather than create
  6. the ID of the record to update
Last updated 3 December 2026commit 6777698daac5Chris Jones
Back to top