MS Dynamics CRM中的帐户联系人关系(Account Contact Relationship in MS Dynamics CRM)

如何将联系人应用于帐户?

所以我有一个帐户和一个联系人

帐户acc =新帐户{Name =“Ab ..”,};

联系co = new联系人{Name =“John”,..};

接着

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

我走在正确的轨道上吗? 或者是否有其他方式将联系人连接到帐户?

How do I apply a contact to an account?

So I have an account and a 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);

Are I on the right track? or is there some other way of connecting contacts to accounts?

最满意答案

CreateOneToManyRequest用于在实体(而不是记录)之间创建新关系,即更改数据库架构。 我认为这不是你想要做的。

要将特定联系人记录附加到帐户,请设置其parentcustomerid属性。 这将是EntityReference或Lookup等,并获取该1:n关系的1侧的ID和类型(“帐户”)。

CreateOneToManyRequest is used to create a new relationship between entities (not records), i.e. change the database schema. I take it this is not what you want to do.

To attach a specific contact record to an account, set its parentcustomerid property. Thîs will be an EntityReference or Lookup or the like and take the ID and type ("account") of the 1 side of that 1:n relationship.

MS Dynamics CRM中的帐户联系人关系(Account Contact Relationship in MS Dynamics CRM)

如何将联系人应用于帐户?

所以我有一个帐户和一个联系人

帐户acc =新帐户{Name =“Ab ..”,};

联系co = new联系人{Name =“John”,..};

接着

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

我走在正确的轨道上吗? 或者是否有其他方式将联系人连接到帐户?

How do I apply a contact to an account?

So I have an account and a 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);

Are I on the right track? or is there some other way of connecting contacts to accounts?

最满意答案

CreateOneToManyRequest用于在实体(而不是记录)之间创建新关系,即更改数据库架构。 我认为这不是你想要做的。

要将特定联系人记录附加到帐户,请设置其parentcustomerid属性。 这将是EntityReference或Lookup等,并获取该1:n关系的1侧的ID和类型(“帐户”)。

CreateOneToManyRequest is used to create a new relationship between entities (not records), i.e. change the database schema. I take it this is not what you want to do.

To attach a specific contact record to an account, set its parentcustomerid property. Thîs will be an EntityReference or Lookup or the like and take the ID and type ("account") of the 1 side of that 1:n relationship.