locked
How to configure CRM plugin Steps to return all contacts on account update? RRS feed

  • Question

  • Hi,

    I have a question about the plugin Registration Tool. On a working Step.

    When The Step update Account runs I want all contacts associated with this account returned in the Account Object. How can I configure this in the Plugin Registration Tool?

    Thanks, Ronald.


    Ronald Put

    Monday, September 23, 2013 8:35 AM

All replies

  • The plugin registration tool cannot be used to return values. The Plugin Registration tool basically allows you to register custom code on pre-defined events.

    In your case, you are looking to return Contacts for an account, though you can write custom code to read contacts for an account, you cannot return it. You can update the primary entity fields through plugin but list of contacts is not a field on the account.

    If you could explain what you are trying to achieve we could possible suggest alternate solutions.

    You can use scripts to read all contacts associated with an account from the CRM form. would that help?

    Sam


    Dynamics CRM MVP | Inogic | http://inogic.blogspot.com| news at inogic dot com

    If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"

    • Proposed as answer by Sam - Inogic Monday, September 23, 2013 8:41 AM
    Monday, September 23, 2013 8:41 AM
  • Hi Sam,

    Thank you for your reply,

    This is what I want to achieve: (Synchronizing a core database from CRM using a plugin)

    1. in CRM contacts are inserted and updated (only when there is A known Account Id in the Core system).
    2. in CRM Accounts are inserted without an ID for a Core system (this insert or update is rejected for Accounts without this ID);
    3. in Account is updated with the ID from the Core system (now the Core database is added a record with the Account);
    4. Because the Account is Added to the database, All Contacts must be added to the Core Database belonging to this Account... (THIS IS THE MISSING FUNCTIONALITY)

    maybe you have a great and creative Idea to fix this... When possible in the plugin

    Ronald. 


    Ronald Put

    Monday, September 23, 2013 9:04 AM
  • So when an account in CRM is updated with the Core System ID you need to read all the contacts associated with the account and add them to the Core System.

    If that is the case, you will register the plugin on the update message of the Account entity. Here you will write the code to read all contacts associated with the account based on Parent Account id == accountid.

    Next establish a connection with the Core System and add the contact records to the Core System database.

    You could look for LINQ or RetrieveMultiple samples for reading contacts associated with account. Check this http://msdn.microsoft.com/en-us/library/gg328149.aspx

    HTH

    Sam


    Dynamics CRM MVP | Inogic | http://inogic.blogspot.com| news at inogic dot com

    If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"

    • Proposed as answer by Sam - Inogic Monday, September 23, 2013 11:00 AM
    Monday, September 23, 2013 11:00 AM