When trying to register a CRM real-time map receiving error saying:
Could not save record. Deleted object would be re-saved by cascade (remove deleted object from associations).
Cause
This error is caused by a CRM field being removed from CRM, while still referenced in the real-time query.
Resolution
If you know which fields were deleted:
- Add the fields back into CRM with the exact same schema.
- Re-register the map
- Optional: remove the field from the real-time query then delete the field out of CRM.
If you do not know which fields were deleted:
- You can run this script against your SmartConnect database to find the FetchXml the real-time query is returning. You will need to change Account with the display name of the entity the trigger is on.
Use SmartConnect
select FetchXml, EntityDescription, Registered
From [MsCrm2011RealTimeDataSource]
Inner Join [RealTimeDataSourceBase] ON [MsCrm2011RealTimeDataSourceId] = [RealTimeDataSourceBaseId]
Where [EntityDescription] =’Account’
- You will need to go through the XML and look for custom fields that are no longer in CRM. These are the fields you need to add back.
- Once the fields are back in CRM register the map.