Loading

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

Дата публикации: Oct 13, 2022
Описание

The OwnerID field is used to associate an Event with a public calendar. It's 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 will result in the error:
 
"invalid cross reference id" or "INVALID_CROSS_REFERENCE_KEY"

As a workaround, export your existing Events, update your export file by setting the new calendar's Id for OwnerId, reinsert the Event as a new Event record, and then delete the original Event.
Решение

 

1. Using Data Loader 45 and above, Export Data 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  
 

2. Export desired Event records using Data Loader and edit the file.
Note: As a best practice, it's recommended to perform at least one export including all fields to retain a backup of the original Event records. 

 
  1. Click on Export button.
  2. Select the Event object.
  3. Enter the name of the file in 'Choose a target for extraction' field. Make sure to add “.csv” at the end of the filename. You may click Browse button to select where you want to save the exported csv file.
  4. Click on the Next button.
  5. Click on Select all fields button. Use the filters to download only the Event records to be moved from one public calendar to another. For example, you could filter by OwnerID equals the old public calendar ID.
  6. Open the csv file that was exported. You will notice that the calendar ID (OwnerID) and Event Record ID (ID) are now 18 digits instead of 15 digits. This is the algorithm of Salesforce in order for MS Excel to recognize the record ID.
  7. Edit the Owner ID column to change it from the old calendar ID to the new calendar ID obtained in Step 1. The calendar ID you put in the OwnerId column refers to the public calendar where you are going to copy the events.
  8. Click on Save As... to create a new version of the edited file and keep the original as backup.
                                               

3. Insert the edited file.
 

  1. From Data Loader, click Insert. Note: Update or Upsert will not work and result in the error 'invalid cross reference id.'
  2. Select the Event object.
  3. ​​​​​​Browse for the location of your csv file.
  4. Double click the filename.
  5. Click on Next. You will see the Data Selection window.
  6. ​​​​​Click on OK.
  7. ​​​​​​Click on Create or Edit Map button.
  8. Click on Auto-Match Fields to Columns button.
  9. Click on OK.
  10. Click on Next.
  11. ​​​​Select where you want to save your success and error file​​​​​.
  12. Click on Finish button.

4. Once you've validated that the new Event records are associated with the expected public calendar, delete Event records from the original public calendar to avoid duplicate Event records.
 
  1. Edit your exported file and make sure it contains only Event records that you want to delete.
  2. In Data Loader, click Delete button.
  3. ​​​​Select the Event object.
  4. ​​​​​​​Browse for the file.
  5. ​​​​​​​Click Next and follow the succeeding prompts.
​​​​​​​
Номер статьи базы знаний

000387135

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