CreateServiceRequest
This event is used to create Service Request records automatically. The following table lists its various attributes.
Attributes
Values
Web service Class Name
CreateServiceRequest
REST Endpoint URI*
/services/apexrest/SVMXC/svmx/rest/IOTServiceIntf/CreateServiceRequest/2.0/
* The REST endpoint URI must be prefixed with http://<your salesforce organization url>. For example, if your Saleforce organization url is na17.salesforce.com, then CreateServiceRequestevent can be invoked as http://na17.salesforce.com/services/apexrest/SVMXC/svmx/rest/IOTServiceIntf/CreateServiceRequest/2.0/.
The event request includes various fields as a part of the web service request payload. The mapping of these fields to the Service Request object fields are as below.
Fields Received in the Payload
Service Request Fields
Event > Subject
SVMXC__Subject__c
SVMXC__Problem_Description__c
Event > Description
SVMXC__Problem_Description__c
Event > AlertType
SVMXC__Problem_Description__c
Event > Property
SVMXC__Problem_Description__c
Event > EventTime
SVMXC__Problem_Description__c
Event > Priority
If value = 1 then SVMXC__Priority__c = "Low"
If value = 2 then SVMXC__Priority__c = "Medium"
If value = 3 then SVMXC__Priority__c = "High"
Asset > ThingName
SVMXC__Problem_Description__c
Others > Installed Product record identified based on External Unique Key field-value pairs
SVMXC__Serial_Number__c = Installed product’s Id
SVMXC__Product__c = Installed product’s Product
SVMXC__Account__c = Installed product’s Company (Account)
SVMXC__Contact__c = Installed product’s Contact
The value of the Problem Description field in the resulting Service Request record is set by concatenating the non-null values of Subject, Description, AlertType, Property, EventTime and ThingName fields from the request payload in the mentioned order. In other words, ServiceRequest.SVMXC__Problem_Description__c = Event.Subject + " " + Event. Description + " " + Event.AlertType + " "+ Event.Property + " " + Event.EventTime + " " + Asset.ThingName.
The contents of the Others group in the request payload are considered only when Installed Product Lookup is configured in your IoT Setup. For each of the field-values pair sent in the Others group, the corresponding field is set in the resulting Service Request record (as per the mapping above) only if there is an exact field-name match in the External Unique Key section of the Installed Product Lookup configuration. Else, the received field-value pair is ignored.
The following example shows how the various fields in a Service Request record are set when the corresponding CreateServiceRequest event is invoked with the following request payload.
{
"Asset": {
"ThingName": "MR-1.5T-XDT-7768",
"ProductName": "MRI Machine",
"InstalledProductName": "MRI Machine #7768",
"SerialNumber": "MR-1.5T-XDT-7768"
},
"Event": {
"Subject": "Vibration detected during machine operation.",
"Description": "5.0 <= 5.5",
"Priority": "2",
"EventTime": "2015-12-29 22: 27: 06.006",
"AlertType": "Above",
"Property": "Vibration",
"ServiceSessionID": "DSBBB0056"
},
"Others": {
"ThingName": "MR-1.5T-XDT-7768",
"ModelYear": "2008",
"ProductionCode": "XDT"
}
}
The following Service Request record is created.
Was this helpful?