简体   繁体   中英

Dynamics Crm insert record with SSIS

With SSIS, I want to insert a record in a CRM table (Contact). In the ownerid field I am inserting the ID of a team, since the owner of the record is a team. But this insertion is not possible, it looks like the system only looks for users and not teams as owners:

[Dynamics CRM Destination [94]] Error: An error occurred with the following error message: "System.Exception: (1) Error: systemuser With Id = cc3b2c21-62d2-e611-80dc-3863bb351f50 Does Not Exist

How can I insert a record specifying that the ownerid must be searched in the teams table?

Edit (in reply to Pawel Gradecki's comment): these are the records about the owner in the Contact entity:

在此处输入图片说明

You have to set also OwnerIdType which is 8 for a SystemUser and 9 for a Team. 在此处输入图片说明

Update: Just to prove this column is available for mapping, I created a SSIS package that connects to an Online deployment of mine and mapped Contact. Here is the screenshot of how the columns look like:

在线联系联系

Short answer: When using SSIS (I am using Kingswaysoft) To assign the owner as a user, use owneridtype = 8

I have no idea why it is 8 instead of 1 as the official d365 documentation suggests, but I found this forum post which suggested 8 and it worked.

https://community.dynamics.com/crm/f/microsoft-dynamics-crm-forum/407667/invalid-error-type-invalid-owneridtype-10076-in-dynamics-crm-2016

Someone can improve this answer by telling us where to find the integers needed for the other types of owner (ie teams).

It is really baffling that the integer to input is 8 instead of 1 as the documentation suggests.

https://docs.microsoft.com/en-us/dynamics365/customer-engagement/web-api/ownershiptypes?view=dynamics-ce-odata-9

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM