Understanding TargetRelatedLeadToAccount class in CRM
Hi,
I saw one question in Microsoft CRM Development forum, it was regarding the TargetRelatedLeadToAccount class. The user was using this class to update the originatinglead attribute in the account record.
This is how we would be using that class
service.Credentials = System.Net.CredentialCache.DefaultCredentials;
service.CrmAuthenticationTokenValue = new CrmAuthenticationToken();
service.CrmAuthenticationTokenValue.AuthenticationType = 0;
service.CrmAuthenticationTokenValue.OrganizationName = “orgName”;
TargetRelatedLeadToAccount targetRlTA = new TargetRelatedLeadToAccount();
targetRlTA.AccountId = new Guid(“accountGuid”);
targetRlTA.LeadId = new Guid(“leadGuid”);
SetRelatedRequest srelReq = new SetRelatedRequest();
srelReq.Target = targetRlTA;
SetRelatedResponse srelRes = (SetRelatedResponse)service.Execute(srelReq);
However as it turned out, this class associates an account record to a particular lead record. It doesn’t update the originatinglead attribute in the account record.
We can find a N:N relationships defined between lead and account named “accountleads_association”. Every time we use the above message a particular account record gets associated to the lead.
We can check for it in the following filtered view “FilteredAccountLeads”.
Bye..
Filed under: CRM, Microsoft Dynamics CRM Tagged: CRM, CRM 4.0
This was originally posted here.

Like
Report
*This post is locked for comments