Connected Field Service > Using Connected Field Service > Updating an Installed Product Record
  
Updating an Installed Product Record
A common need is to perform some simple updates in ServiceMax driven by events or property updates in ThingWorx. While this example is focused on updating Installed Product records, it can also be applied to any relevant ServiceMax object type.
* 
The ServiceMax Connector is designed to directly support Integration Hub Resources. If you have datashapes that are already populated, use the ServiceMax Connector directly. In practice, many use cases may not have full resources. The following examples assist in using the ServiceMax Connector in those situations.
General Information You Will Need
The Salesforce “API name” of the ServiceMax object you wish to update
The ServiceMax business key(s) to uniquely identify the object
See How Do I Find the API Name and Fields of a Service Max Object? for help finding this information.
Installed products have an API name of SVMXC__Installed_Product__c.
The unique business keys for Installed Products vary by customer. Commonly used fields include:
Salesforce Label (default)
API Field
Installed Product ID
Name
Product Name
SVMXC__Product_Name__c
Serial/Lot Number
SVMXC__Serial_Lot_Number__c
Asset Tag
SVMXC__Asset_Tag__c
Once you have determined your API object name and the field names of your business keys, you can use the following methods to perform an update:
PTC.CSLM.SalesforceUtils FindIdByKeys: This service method assists by finding the Salesforce key (ID) of a Salesforce object using the business keys. It ensures that it is unique and fails if there is no record or more than one. It returns the Salesforce ID, which can then be used to update the record.
PTC.CSLM.Connector.SalesforceConnector UpdateResources: This service is used to update objects in Salesforce. It can be called in many ways but for this situation, only the following parameters are needed:
salesforceObjectType: The API name of the object to update.
objects: Infotable of the data to be updated. This can be a partial set of fields but must include the ID. The ID field is the primary key and is required for an update.
Examples
The following complete example service methods using the previously mentioned methods can be found in PTC.CSLM.Demo.ServiceMaxUpdates:
UpdateInstalledProductStatus
UpdateInstalledProductStatusByModeISN
UpdateInstalledProductStatusViaDataShape
Review the implementation of these methods to create your own similar methods as needed.