TargetRelatedDynamic not working

TargetRelatedDynamic not working

Post by QnJvY2 » Thu, 29 May 2008 01:06:00

I've created a custom entity and I have a 1:N relationship setup between a
contact and my custom entity. Ideally this would be 1:1 but I didn't see a
way to wire this up.

Is it possible to setup a relationship between a custom entity that isn't
N:N (that one Associa *** titiesRequest does the trick). If there a multiple
relationships between contact and my custom entity how does it know which one
to use?

TargetRelatedDynamic relationship = new TargetRelatedDynamic();
relationship.Entity2Id = myGuid;
relationship.Entity2Name =;

relationship.Entity1Id = crmUserAccount.myEntityId.Value;
relationship.Entity1Name = EntityName.myEntity.ToString();

SetRelatedRequest relationshipRequest = new SetRelatedRequest();
relationshipRequest.Target = relationship;
service.Execute(relationshipRequest); // Always errors out.

TargetRelatedDynamic not working

Post by Michael Hn » Sun, 01 Jun 2008 05:39:36

In that case, you have appropriate attributes in either the contact or your
custom entity. You can use an Update call to set these values.

Michael Hne, Microsoft Dynamics CRM MVP

CRM Blog:


"Brock" < XXXX@XXXXX.COM > schrieb im Newsbeitrag