Loading

Error 'invalid cross reference ID' on Events transfer between public calendars

Дата публикации: May 14, 2026
Описание

The OwnerId field is used to associate an Event with a public calendar in Salesforce. It is not currently possible to move an Event from one public calendar to another public calendar by updating OwnerId via Data Loader.
Attempting to update an existing Event's OwnerId from one calendar to another results in the error: "invalid cross reference id" or "INVALID_CROSS_REFERENCE_KEY".
As a workaround, export the existing Events, update the OwnerId in the export file to the new calendar's Id, reinsert the Events as new records, and then delete the original Events.

Решение

To transfer Events between public calendars in Salesforce, you cannot directly update the OwnerId field via Data Loader. Instead, follow this four-step process: export the existing Events, update the OwnerId to the new calendar's ID, insert them as new records, and delete the originals.

Step 1: Export Public Calendar IDs

Using Data Loader 45 or above, export from the Calendar object to gather a list of Public Calendar IDs.
Example export query: SELECT Id, Name FROM Calendar WHERE Type = 'Public' AND IsActive = True

Step 2: Export and Edit Event Records

  1. In Data Loader, click Export and select the Event object.
  2. Enter a filename with a .csv extension and choose a save location.
  3. Click Next, then Select all fields. Use filters to download only the Events to be moved (for example, filter by OwnerId equals the old public calendar ID).
  4. Open the exported CSV file. Note that the calendar ID (OwnerId) and Event Record ID (ID) appear as 18-digit IDs.
  5. Edit the OwnerId column to change it from the old calendar ID to the new calendar ID obtained in Step 1.
  6. Use Save As to create a new version of the edited file and keep the original as a backup.

Note: As a best practice, perform at least one full export including all fields to retain a backup of the original Event records.

Step 3: Insert Edited Events as New Records

Important: Use Insert — not Update or Upsert — as Update will result in the 'invalid cross reference id' error.

  1. In Data Loader, click Insert and select the Event object.
  2. Browse for the edited CSV file and click Next.
  3. Click Create or Edit Map, then Auto-Match Fields to Columns. Click OK.
  4. Click Next, select a location for success and error log files, then click Finish.

Step 4: Delete Original Events

Once the new Event records are confirmed in the target calendar, delete the original Events to avoid duplicates.

  1. Edit your exported file to include only the original Event records to be deleted.
  2. In Data Loader, click Delete and select the Event object.
  3. Browse for the file, click Next, and follow the prompts.
​​​​​​​
Дополнительные ресурсы

Data Loader 
Export Data
Calendar

Номер статьи базы знаний

000387135

 
Загрузка
Salesforce Help | Article