Answered by:
Many to many relationship, How to

Question
-
Hi,
I have created a many 2 many relationships in lead entity from product entity & I have also created a many 2 many relationships for account entity from product entity. I want when I convert lead into account, these relationship related records also create in account entity with particular that account.
How is it possible?
Can we do it by workflow? How?
Can we do it by plug-ins? How?
G. Goyal- Moved by Mathias Schiffer Monday, June 22, 2009 9:52 AM English Language Post (From:Microsoft Dynamics CRM)
Monday, June 22, 2009 5:17 AM
Answers
-
Hi. This cannot be made with workflow.
This can be made with plugin.
You need write a plugin on create account entity and in its body control is 'originatingleadid' property in account entity in context. If there is such property - this account is converted from lead.
Then you have to read all products using retrieve multiple products which are related to originating lead and then using AssociateEntities message - add retreived products to newly created account.
Truth is opened the prepared mind My blog - http://a33ik.blogspot.com- Marked as answer by Donna EdwardsMVP Friday, July 10, 2009 7:12 PM
Monday, June 22, 2009 9:58 AMModerator -
refer to the SDK dokumentation for examples:
Maybe this will guide you:
To Update records you would need to follow the SDK.
http://msdn.microsoft.com/en-us/library/cc677074.aspx
Tiaan van Niekerk http://crmdelacreme.blogspot.com Skype:tiaan.van.niekerk1- Proposed as answer by Tiaan van Niekerk Monday, June 22, 2009 10:14 AM
- Marked as answer by Donna EdwardsMVP Friday, July 10, 2009 7:12 PM
Monday, June 22, 2009 10:13 AM
All replies
-
Hi. This cannot be made with workflow.
This can be made with plugin.
You need write a plugin on create account entity and in its body control is 'originatingleadid' property in account entity in context. If there is such property - this account is converted from lead.
Then you have to read all products using retrieve multiple products which are related to originating lead and then using AssociateEntities message - add retreived products to newly created account.
Truth is opened the prepared mind My blog - http://a33ik.blogspot.com- Marked as answer by Donna EdwardsMVP Friday, July 10, 2009 7:12 PM
Monday, June 22, 2009 9:58 AMModerator -
refer to the SDK dokumentation for examples:
Maybe this will guide you:
To Update records you would need to follow the SDK.
http://msdn.microsoft.com/en-us/library/cc677074.aspx
Tiaan van Niekerk http://crmdelacreme.blogspot.com Skype:tiaan.van.niekerk1- Proposed as answer by Tiaan van Niekerk Monday, June 22, 2009 10:14 AM
- Marked as answer by Donna EdwardsMVP Friday, July 10, 2009 7:12 PM
Monday, June 22, 2009 10:13 AM