Remote Triage > Remote Triage for Administrators > Configuration > Configuring Resolution Information Sent to Remote Triage on Work Order Closure
Configuring Resolution Information Sent to Remote Triage on Work Order Closure
After the work order is reviewed and closed, the information about the actions performed and parts used must be sent to Remote Triage. This information is used to improve predictions. The fields and records to be sent must be configured using a JSON configuration structure. This structure must be provided as an input to the admin service, which is as follows:
Class Name: SVMXAI.AQT_AdminService
Method: setApiConfig(String apiConfiguration)
API Configuration Specification
{
"version": "1",
"work": {
"objectName": "SVMXC__Service_Order__c",
"assetField" : "SVMXC__Component__c",
"visitDate": "SVMXC__Scheduled__c",
"idField": "SVMXC__Case__r.CaseNumber",
"solutionFields": ["field1", "field2"],
"apiMap": [{
"key": "model",
"field": "model__c"
},
{
"key": "manufacturer",
"field": "manufacturer__c"
},
{
"key": "producttype",
"field": "product_type__c"
}
]
},
"parts": {
"objectName": "SVMXC__Service_Order_Line__c",
"parentField": "SVMXC__Service_Order__c",
"apiMap": [{
"key": "name",
"field": "SVMXC__Product__c"
}, {
"key": "original_id",
"field": "SVMXC__Product__r.ProductCode"
}],
"expression": {
"exprId": "expressionId",
"name": "expressionName"
}
}

}
The following table contains information about the fields from the work order object to be sent to Remote Triage.
* 
This table contains the description of the configurable parameters of the work attribute.
Key
Description
Value
objectName
API name of the work order object.
SVMXC__Service_Order__c
assetField
This is the asset for which work is performed. Specify the API name of the field on the work order object.
SVMXC__Component__c
visitDate
The date on which work is performed. Specify the API name of the field on the work order object.
SVMXC__Scheduled__c
solutionFields
Fields in which the work performed information is stored. This is an array of field API names from the work order object.
SVMXC__Work_Performed__c
apiMap
An array of objects that contain asset details. Each object has a key and a field. The keys are:
model
manufacturer
producttype
The field must have the API names of the field on the work order object for the respective keys.
The following table contains information about parts that have been used to fix the issue. These are fields from the Work Detail object sent to Remote Triage.
* 
This table contains the descriptions of the configurable parameters of the part attribute.
Key
Description
Value
objectName
API name of the work detail object.
SVMXC__Service_Order_Line__c
parentField
API name of the lookup to Work Order object on work details.
SVMXC__Component__c
apiMap
An array of objects that contain details of parts used to fix the issue. Each object has a key and a field. The keys are “name,” “original_id. The field must have the API names of the field on the work detail object for the respective keys. Relationship references are supported for this configuration.
SVMXC__Product__r.name for name
SVMXC__Product__r.ProductCode for original_id
Expression
The object that contains Expression ID and Expression Name. SFM Expression ID to identify parts lines used to debrief parts used to fix the issue. Expression ID must be specified.
Sample Script
You can run the sample script in the Developer Console or Workbench to create or update the API configuration. The API names in the JSON input string must be replaced with the correct field names (used in the implementation) from the Work Order object.
String jsonInput = '{ ' +
' "version": "1",' +
' "work": {' +
' "objectName": "SVMXC__Service_Order__c",' +
' "visitDate": "SVMXC__Scheduled_Date__c",' +
' "assetField": "SVMXC__Component__c",' +
' "idField": "SVMXC__Case__r.CaseNumber",' +
' "solutionFields": ["SVMXC__Special_Instructions__c", "SVMXC__Work_Performed__c"],' +
' "apiMap": [{' +
' "key": "model",' +
' "field": "model__c"' +
' },' +
' {' +
' "key": "manufacturer",' +
' "field": "manufacturer__c"' +
' },' +
' {' +
' "key": "producttype",' +
' "field": "product_type__c"' +
' }' +
' ]' +
' },' +
' "parts": {' +
' "objectName": "SVMXC__Service_Order_Line__c",' +
' "parentField": "SVMXC__Service_Order__c",' +
' "apiMap": [{' +
' "key": "name",' +
' "field": "SVMXC__Product__r.name"' +
' }, {' +
' "key": "original_id",' +
' "field": "SVMXC__Product__r.ProductCode"' +
' }],' +
' "expression": {' +
' "exprId": "EXPR018",' +
' "name": "SVMXSTD: Parts Usage Lines Only"' +
' }' +
' }' +
'}';
SVMXAI.AQT_AdminService adminSvc = new SVMXAI.AQT_AdminService();
adminSvc.setApiConfig(jsonInput);
Invoking the API
The API is invoked using a packaged process, AQT_IG_SubmitWorkorder. This process is triggered when the work order status is set to the Closed state. You must ensure that this process is Active on the Work Order object.
To define a custom process using Process Builder if the actual information must be sent under different conditions:
1. Select the Apex Action type in the Process Builder configuration.
2. Configure Apex Variables to be sent to this action:
The variable name is workorders.
The type is Field Reference.
3. Click the lookup icon in the Value field, which will launch a dialog box to configure the value.
4. Select the Select the SVMXC__Service_Order__c record that started your process option.
5. Click Choose.
Was this helpful?