Link to an account in MS Dynamics CRM

How do I apply a contact to an account?

So I have an account and contact

Account acc = new account {Name = "Ab ..",};

Contact co = new Contact {Name = "John", ..};

And then

CreateOneToManyRequest createOneToManyRelationshipRequest =
                        new CreateOneToManyRequest
{
   OneToManyRelationship = new OneToManyRelationshipMetadata
   {
       //What should I put here?
   },
   Lookup = new LookupAttributeMetadata
   {
       //And here?
   }
};
CreateOneToManyResponse createOneToManyRelationshipResponse =
                        (CreateOneToManyResponse)_serviceProxy.Execute(
                        createOneToManyRelationshipRequest);

Am I on the right track? or is there any other way to connect contacts to accounts?

+3
source share
1 answer

CreateOneToManyRequestused to create a new relationship between entities (no records), i.e. database schema changes. I suppose this is not what you want to do.

, parentcustomerid. Thss EntityReference Lookup , ( " " ) 1 1: n.

+5

Source: https://habr.com/ru/post/1795989/


All Articles