ETL software cannot get contact owner

The first question, with my ETL software, I could map all GM contact fields and transfer them to the MCRM contact organization. The only field that I can’t is the owner (the owner is always the creator of the contact).

I found that they are privileges in these prvAssignContact entity fields .

Is it a trick to remove this security or something that I could do with the SDK Toolbox that I just started using yesterday?

In SO, I found this topic, Can I update the Contact Owner ID using LINQ? but just don’t know if it will be useful for me and if so, where to put this code.

P: S: I definitely should do it alone ... so I would have liked the friendly tips!

+2
source share
2 answers

In addition to Guido's answer, if you use impersonation in your IOrganizationService, it will automatically set the owner for genuine users.

0
source

It will be useful to know which ETL you are using, however it is important to consider when you transfer data. If you are creating a new record, specifying the owner is enough to set the field with EntityReference

        Entity contact = new Entity("contact");
        contact["firstname"] = "John";
        Guid ownerId = new Guid("BFC777ED-5E79-E111-8489-00166D63156F");
        contact["ownerid"] = new EntityReference("systemuser", ownerId);
        service.Create(contact);

If you are updating a contact, you need to use AssignRequest as described in another section

        Guid contactId = new Guid("90F8889F-EB95-E781-8417-000C44420CBC");
        Guid newOwnerId = new Guid("BFCAA4ED-5E79-E781-8349-00155BB3156F");
        AssignRequest assignRequest = new AssignRequest
        {
            Assignee = new EntityReference("systemuser", newOwnerId),
            Target = new EntityReference("contact", contactId)
        };
        service.Execute(assignRequest);
+3
source

All Articles