locked
Flagging the primary contact RRS feed

  • Question

  • Imagine the primary contact relationship between Account & Contact.  Then imagine a boolean on the Contact that flags him as the primary contact.

    What approach would you take to synchronize the two?  Admittedly the 1-to-1 updates are pretty straight forward even for jscript in the close event.  What about incrementing through the other related contacts to "uncheck" them as primary contact?
    Tuesday, September 1, 2009 6:18 PM

Answers

  • They both refer to .net code, but they are not handled the same by CRM.  A workflow activity is a bit code of code which is added to a workflow to perform a function the standard workflow cannot, such as updating related records.  A plug-in is .net code as well, but plug-ins can be run synchronously and can be executed before or after changes to the CRM record occur, whereas workflows are only executed after a change.

    According to the SDK help file: 

    You should use workflow to drive straightforward processes using entities in Microsoft Dynamics CRM and to push data out or to retrieve data. Use callouts to coordinate multiple external systems. Use Microsoft BizTalk Server or another solution to coordinate events coming from another system.

    • Marked as answer by Jim Glass Jr Friday, September 4, 2009 6:40 PM
    Wednesday, September 2, 2009 4:07 PM

All replies

  • Assuming you want the account form to accurately reflect the current primary contact, there are two main scenarios to handle:

    First, the primary contact is changed from the account form.
    Second, the checkbox is checked on the contact form.

    I would write a workflow which updates the primary contact to the contact whose box was just checked; it would run whenever the primary contact checkbox was checked.

    I would write a custom workflow activity on the account which loops through the associated contacts and updates the checkbox to whether that contact is listed as the primary on the account form.

    These two workflows would handle both scenarios.

    Tuesday, September 1, 2009 8:18 PM
  • Do the terms custom workflow and plug-in mean the same thing?
    Wednesday, September 2, 2009 3:28 AM
  • They both refer to .net code, but they are not handled the same by CRM.  A workflow activity is a bit code of code which is added to a workflow to perform a function the standard workflow cannot, such as updating related records.  A plug-in is .net code as well, but plug-ins can be run synchronously and can be executed before or after changes to the CRM record occur, whereas workflows are only executed after a change.

    According to the SDK help file: 

    You should use workflow to drive straightforward processes using entities in Microsoft Dynamics CRM and to push data out or to retrieve data. Use callouts to coordinate multiple external systems. Use Microsoft BizTalk Server or another solution to coordinate events coming from another system.

    • Marked as answer by Jim Glass Jr Friday, September 4, 2009 6:40 PM
    Wednesday, September 2, 2009 4:07 PM