{
"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"
}
}
}
|
|
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.
|
|
|
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.
|
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);
