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..
Discover more from Nishant Rana's Weblog
Subscribe to get the latest posts sent to your email.

Hello Nishant Rana,
Thankyou for this overview as I cannot see any information on this in the SDK.
Do have have an idea what having records in the many to many relationship actually acheives?
We cannot even add these relationships to be shown on the form, and the relationship does not link the activities from the lead like with ‘originating lead’ attribute?
Regards,
JdZ
LikeLike