pub.synchronization.xref:getCanonicalKey
WmPublic. Retrieves the canonical key for a specified native ID.
Input Parameters
appId | String A unique identifier for the resource (application) that contains the native ID for which you want to retrieve a canonical key. |
nativeId | String A unique identifier for the resource record for which you want to obtain the canonical key. |
objectId | String A unique identifier for the object or process being synchronized. Typically, the objectId field is set to the name of the business process for which you are performing synchronization, such as "order" or "customer." |
Output Parameters
canonicalKey | String The canonical key for the provided native ID. If the requested key cannot be found or does not exist in the cross-reference table, an empty string is returned. |
Usage Notes
You can use this service to determine whether you need to insert or update a record in the resource.
If the canonical key exists (
canonicalKey contains a value), a cross-reference between the native ID and the canonical key already exists. The record with the specified
nativeId is not a new record. You can then invoke the
pub.synchronization.latch:isLatchClosed service to determine whether the resource needs to be updated.
If the canonical key does not exist (
canonicalKey contains an empty string), then the record with the native ID is a new record. You can use the
pub.synchronization.xref:createXReference service to generate the canonical key and create the cross-reference to the native ID.
For more information about using the getCanonicalKey service in synchronizations, see the Publish-Subscribe Developer’s Guide.
See Also