---
schema_version: "1"
id: d4d05668473d2fe905724c61fc807aa10f44eb2a80fca3ccdc5c343c0bae46ad
title: External IDs and Global Keys (Managed Package)
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/xcloud/264-0-0/os_build_tool_global_keys.md
canonical_url: https://help.salesforce.com/s/articleView?id=xcloud.os_build_tool_global_keys.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: b98ab88933d755361ad333e73ece22b3b56bcc410e2add8f2659f13d2334396e
description: For the managed package runtime, most objects that are being deployed have a field or set of fields that are used to find unique records like an External Id in Salesforce. For many objects, the Global Key field is used. If a deployment finds one object that matches the global key, it overwrites that object during deploy.
products:
  - Omnistudio
release: "264"
---
# External IDs and Global Keys (Managed Package)

For the managed package runtime, most objects that are being deployed have a field or set of fields that are used to find unique records like an External Id in Salesforce. For many objects, the Global Key field is used. If a deployment finds one object that matches the global key, it overwrites that object during deploy.

![Managed Package app icon](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio_for_managed_packages-264-0-0-production-enus/aa2554ec-624a-4ee6-8da4-6435670e6e62/resources-global/_corporate/images/managedpackageicon.png) This information is for Omnistudio for Managed Packages. For Omnistudio on standard runtime, see [Omnistudio Help](https://help.salesforce.com/s/articleView?id=xcloud.os_omnistudio_standard.htm&language=en_US).

If the deployment finds more than one object, it causes this error:

```
Deploy Error >> Product2/02d3feaf-a390-2f57-a08c-2bfc3f9b7333 --- iPhone --- 
Duplicate Results found for Product2 WHERE 
vlocity_cmt__GlobalKey__c=02d3feaf-a390-2f57-a08c-2bfc3f9b7333 - Related Ids: 
01t1I000001ON3qQAG,01t1I000001ON3xQAG
```

This error means that duplicates have been created in the org and the data must be cleaned up.

While there are protections against missing or duplicate global keys the logic is often in triggers which may have at points been switched off, and sometimes applies to data that may have existed before the Vlocity Package was installed.

This command starts a set of batch jobs to add global keys to any objects that are missing them:

```
vlocity -propertyfile <propertyfile> -job <job> runJavaScript -js cleanData.js
```

This Node.js script adds global keys to all SObjects that are missing them, and deletes stale data records.

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio_for_managed_packages-264-0-0-production-enus/aa2554ec-624a-4ee6-8da4-6435670e6e62/images/icon_note.png)

Note If you’re deploying data between orgs, and both orgs are missing global keys but have data that you don’t want to duplicate, use a different strategy to produce global keys that match.