[英]How do I associate an account to a contact using C#/SDK in Microsoft Dynamics/CRM?
Hello. 你好。
I have sort of associated an account to a contact using C#/SDK. 我已经使用C#/ SDK将帐户与联系人相关联。 I used the parentcustomerid attribute on the contact entity.
我在联系人实体上使用了parentcustomerid属性。 If I go the CRM website (click this link ) and look up all the active contacts under my name, it is showing the acct under organization.
如果我去CRM网站(单击此链接 )并以我的名字查找所有活动联系人,则显示组织下的acct。 But when I click on the acct and want to view the details (click this link ), I cannot see any reference to the organization listed in the list.
但是,当我单击acct并想要查看详细信息(单击此链接 )时,我看不到对列表中所列组织的任何引用。
I also manually created a new contact using the Dynamics website (ie not SDK) and I can't find a way on entering a relationship. 我还使用Dynamics网站(即不是SDK)手动创建了一个新联系人,但找不到联系的方法。
Any ideas on how to do it via C# and via the website? 关于如何通过C#和网站进行操作的任何想法?
Thanks very much 非常感谢
for two entities to be linked to each other in CRM 2011. A field of type lookup
is used to make relationship. 在CRM 2011中彼此链接的两个实体。类型
lookup
字段用于建立关系。
for example: 例如:
We want to associate account
to contact
. 我们想关联
account
进行contact
。 So that each contact will be in an account. 这样每个联系人都会在一个帐户中。 or there will be a
parent account
of each contact
. 否则每个
contact
都有一个parent account
。
So here are the steps in CRM 2011 Dynamics Website: 因此,这是CRM 2011 Dynamics网站中的步骤:
contact
formeditor contact
编队 New Field
New Field
Lookup
in Type Lookup
Save and Close
Now Open any existing contact, you will find a new Lookup field on the contact, click and select any Account. 现在,打开任何现有联系人,您将在该联系人上找到一个新的Lookup字段,单击并选择任何客户。 A relationship will be created between them.
它们之间将建立关系。
In C#
to create a new contact
to be linked to account
, below is the following code: In C#
中创建要链接到account
的新contact
,以下代码如下:
Entity Contact_To_Be_Created = new Entity("contact");
Contact_To_Be_Created.Attributes.Add("your_lookup_name",new EntityReference("account",GUID_of_the_account_you want to link));
Service.create(Contact_To_Be_Created );
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.