Applies to Product - Microsoft Dataverse
What’s happening?
The customer is seeking a method to perform a deep upsert using the Dynamics CRM Web API to create related records, for example to associate an existing address record with a newly created parent record instead of creating a new address.
Reason:
The requirement is to modify the API call to include the address name (potentially using an alternate key) so that if an address with that name exists, it can be associated with the newly created parent record. If no address is found, a new address record should be created and associated with the record.
Resolution:
- It is not possible to perform this operation through a single API call.
- The recommended approach is to first check for the existence of the address.
- If the address exists, create the parent record using the existing address.
- If the address does not exist, create it as a related record for parent table.
- For further details on deep insert, refer to the article on creating related table rows in one operation.
